您好,欢迎来到醉满楼美食网。
搜索
您的当前位置:首页angularJS中$scope方法使用指南_AngularJS

angularJS中$scope方法使用指南_AngularJS

来源:醉满楼美食网


代码如下:




无标题文档







{{item}} + {{m}}




var app = angular.module("app", []);
function c($scope){
$scope.items = [1,2,2,3,4,5,5];
$scope.m = "string";
};
app.directive("dir",function($parse){
return {
compile : function( $compile ){
return function(s,e,a){
//what .. ..
//a.ngModel
//用$("xxx").scope.xx = model
//assign 分配
//console.log( $parse( a.ngModel ).assign(s,"sdfs__________newValue__________dfd") )
s.m = "sdfs____#@$#@$#@$@#$__dfd这两个效果一摸一样";
}
}
}
});


Copyright © 2019- zuimanlou.com 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务