In one blog i read we could avoid keyword "$scope", inside the controller 
function. I wrote a sample the span element is working but the click event 
is not working. Am i missing comething. I put a breakpoint in the function, 
it is not getting inside the funcion

Inside my controller function
angular.module("sales",[]).controller("SalesController", SalesController);
function SalesController($scope, $http, $location, SalesService, 
SharedData) {
var vm = this;
vm.name="initial value"
vm.clickme=function(){
vm.name="changed value"
}
// below will work
//$scope.clickme=function(){
//vm.name="changed value"
//}
}

<div class="container-fluid" ng-controller="SalesController as vm" 
ng-init="initializeController()">
<span ng-bind="vm.name"></span>
<button ng-click="clickme()">click</button>
</div>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to