Page History
...
Code Block | ||
---|---|---|
| ||
angular.module('testservice',['servoy'])
.factory("testservice",function($window,$services) {
var scope= $services.getServiceScope('testservice');
return {
talk: function() {
alert("talk: " + scope.model.text);
scope.model.text = "something else"
}
}
})
.run(function($rootScope,$services)
{
var scope = $services.getServiceScope('testservice');
// watch the whole model (you can also use 'model.text' to only watch the text property)
scope.$watch('model', function(newvalue,oldvalue) {
// handle state changes
}, true);
}) |
...
Overview
Content Tools
Activity