Angularjs Uncaught Error: [$injector:modulerr] when migrating to V1.3

前端 未结 4 538
我寻月下人不归
我寻月下人不归 2020-11-22 10:47

I am learning Angular.js and I am not able to figure out whats wrong with this simple code. It seems to look fine but giving me following error.



        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 11:23

    You have to define your controller

    var app = angular.module('app', []);
    
    app.controller('Ctrl', ['$scope',function($scope) {
      $scope.age = 24;
    }]);
    

提交回复
热议问题