MiniMe was born out of a necessity to keep my jquery code more organised.
The configurations are always executed first, you can put the events here that are not bound to a specific controller. (I strongly suggest using a proper controller, but if you have to work with lots of legacy code)
Definition
app.configuration(function(){
//Code that needs to be executed when you initialise MiniMe
});
Controllers should always be as slim as possible, only the logic should be defined here.
app.controller('MyNewController',function(constructParams){
//Your Controller Function
});
AddEvent This will add a new event and bind it to the controller scope.
this.addEvent(element,event,function(){
});
<div class="some-div" data-controller="myController" data-controller-params="{\"json\":true}">
</div>
data-controller |String| Which controller will manage all the events inside the div. data-controller-params |Json| Optional. Additional parameters that can be passed to the controller
I love services, all the servicey stuff and the heavy stuff should be put in here.
app.service('MyNewService',function(){
return function (constructParam1,constructParam2) {
this.log = function (logExample) {
console.log(logExample);
}
};
},Resolve);
Or
app.service('MyNewService',function(){
return {
log:function(){
console.log(logExample);
}
;}
});
Resolve: |Boolean| by default set to true it will tell MiniMe if you want to execute the return function on initialisation.
app.get()
app.get(ServiceName,args...)
Just call at the end, after all the definitions
app.run(debug)
Debug |Boolean| If you need to debug MiniMe.
It's a wrapper class for the console command. Use the Brackets to highlight the text inside (it will become bold and blue).
app.get('Debug').log("This is my {Text}",{a:1,b:2});
- Add TemplateHelper
- Write Better Docs
- Write Better Example