How can I use scope change event in services in angularJs -
i have controller , service. want controller code moved services create reusable. problem facing here controller using $scope service. means code dependent on $scope event. if move code service, how manage $scope event alter in service.
i don't know if effective way, can pass $scope function parameter.
controller:
myservice.amethod($scope, otherparameter);
service:
this.amethod = function (scope, otherparameter) { scope.result = otherparameter * 10; }
angularjs
No comments:
Post a Comment