javascript - AngularJS ng-controller not working -
i started learning on angularjs w3schools. trying practice examples ever have mentioned in tutorials. every thing works fine when came "angularjs controllers" not working working in w3schools seek ». ve forked code fiddle example. script looks this:
function personcontroller($scope) { $scope.firstname= "john"; $scope.lastname= "doe"; }
try help me out , suggest me tutorial(or free pdf file).
this corrected fiddle.
it practice angular controller definition must this:
angular.module("app", []).controller("personcontroller", function($scope) { $scope.firstname = "john"; $scope.lastname = "doe"; });
and, without doubt, best tutorial ever learning basics of angular codeschool one!
hope helps.
javascript html angularjs
No comments:
Post a Comment