I'm trying to use Angularjs. How can I show a result of a function in a view?
I have a HTML like this.
<body ng-controller="fooCtrl">
<p>a: {{ a }}</p>
<p>b: {{ b }}</p>
</body>
And javascript for it.
fooApp.controller('fooCtrl', ['$scope', function ($scope) {
$scope.a = 3;
$scope.b = function(){
return 4;
};
}]);
a is properly shown, but b is blank. What am I doing wrong?