I was told that I should use the app.controller syntax in order to support mini-tuning.
Rewriting an example (tutorial), and I found that I can't get it to work:
use 'strict'; var app = angular.module('myApp', ['ngGrid']);
function PhoneListCtrl($scope, $http) { $http.get('phones/phones.json').success(function (data) { $scope.phones = data; }); $scope.orderProp = 'age'; } PhoneListCtrl.$inject = ['$scope', '$http'];
<body ng-app="myApp" ng-controller="PhoneListCtrl"> {{phones | json}} </body>
What do i need to change?
javascript angularjs dependency-injection angularjs-scope controller
user2283066
source share