0
在角的在线免费课程,我看到:
app.controller('GalleryController', function(){
this.current = 0;
this.setCurrent = function(imageNumber){
this.current = imageNumber || 0;
};
});
但通常$scope
作为参数传递给控制器过去了......所以,是不是真的需要?
我很害怕事实并非如此。当前的prop和setCurrent方法就像它们在$ scope上定义一样工作。所以它不是需要或不需要的。不管怎么说,还是要谢谢你。 – user1769128 2014-11-03 12:44:55