首页 > 其他 > 详细

angular note2

时间:2015-03-17 21:38:38      阅读:375      评论:0      收藏:0      [点我收藏+]

regarding of most applications, you need to create model object to contain you data.

 

var messages = {};

messages.someText = ‘You have started your journey.‘

 

xxModule.controller(‘XXController‘,function($scope){

  $scope.messages = messages;

});

 

<p>{{messages.someText}}</p>

 

在稍后讨论$scope对象的时候我们将会看到,像这样创建模型对象的方式可以避免一些非预期的行为,这些行为可能是由$scope对象中的原型继承机制所导致的。

 

angular note2

原文:http://www.cnblogs.com/specification/p/4345372.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!