Pass variables to AngularJS controller, best practice?

前端 未结 3 1499
难免孤独
难免孤独 2020-11-29 17:13

I am brand new to AngularJS and like what I\'ve seen so far, especially the model / view binding. I\'d like to make use of that to construct a simple \"add

3条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 18:05

    You could use ng-init in an outer div:

    The parameter will then be available in your controller's scope:

    function BasketController($scope) {
            console.log($scope.param);
    }
    

提交回复
热议问题