I'm quite stuck on trying to access the view with an expression that obviously fails to work. I have a Service:
angular.module('myApp', []).service('myService', function($timeout){
this.sayHello = function(name) {
$timeout(function(){
alert('Hi, I am...' +name);
}, 3000);
};
});
Controller:
angular.module('myApp.controllers', [])
.controller('MyController', function(myService) {
myService.sayHello('AngularJS Service');
});
View
<div ng-controller="MyController">{{sayHello}}</div>
In the view I have:
{{sayHello()}}
What am I doing wrong?