AngularJS "Controller Undefined error" while displaying the scope value in .php extension file -
while displaying scope value in file ".php" extension gives error of undefined controller, while displays scope value properly.
sample code:
<script> (function(){ var app = angular.module('demoapp', []); app.controller('democtrl', function($scope){ $scope.name = "test"; }); })(); </script> <div ng-app="demoapp"> <div ng-controller="democtrl"> {{name}} </div> </div>
the above code, shows value of name in browser correctly , in console gives following error
"angular.min.js:103 error: [ng:areq] http://errors.angularjs.org/1.3.11/ng/areq?p0=democtrl&p1=not%20a%20function%2c%20got%20undefined"
what wrong code? angular version used 1.3.11
Comments
Post a Comment