angularjs - Should I declare "var" variables in an Angular controller or always use $scope -
if have controller such as:
myapp.controller('newcontroller', function ($scope, $window) { var x = 5; $scope.y = 5; }); and x , y going changed application, make difference whether or not declare var x on $scope or declare var right now?
$scope glue between rendered view , controller. if don't need variable in view, don't add $scope object.
Comments
Post a Comment