Monday 15 July 2013

angularjs error argument 'controller' is not a function got undefined -



angularjs error argument 'controller' is not a function got undefined -

hello i've been searching reason why code doesn't work can't find it. i've found similar question posted here non help. code.

<!doctype html> <html ng-app="app"> <head> <meta charset="utf-8"> <title>angularjs tests</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script> </head> <body ng-controller="ctrl"> <input type="text" ng-model="blog"><br> <br> {{blog}} <script> var app=angular.module('app',[]); app.controller=('ctrl', ['$scope',function($scope){ $scope.blog="text"; }]); </script> </body> </html>

app.controller = ( ... ); not valid syntax.

app.controller('ctrl', ...);

angularjs

No comments:

Post a Comment