<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<script src="http://localhost:81/js/jquery.js">
</script>
<script src="http://localhost:81/js/angular.min.js">
</script>
<body ng-app="app" ng-controller="c">
<div dir ng-repeat="item in items" ng-model="m">
{{item}} + {{m}} <br>
</div>
</body>
<script>
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这两个效果一摸一样";
}
}
}
});
</script>
</html>

  

angular-scope.assign的更多相关文章

  1. angular $scope对象

    $scope是一个pojo对象 $scope提供了一些工具方法.例如:$watch() $apply(),一般不会手工去调用 $scope是表达式的执行环境也叫作用域 $scope是一个树形结构,与D ...

  2. Angular $scope和$rootScope事件机制之$emit、$broadcast和$on

    Angular按照发布/订阅模式设计了其事件系统,使用时需要“发布”事件,并在适当的位置“订阅”或“退订”事件,就像邮箱里面大量的订阅邮件一样,当我们不需要时就可以将其退订了.具体到开发中,对应着$s ...

  3. [AngularJS] Using the Angular scope $destroy event and method

    With Angular scopes, you have access to a $destroy event that can be used to watch $scope events. Th ...

  4. Angular $scope和$rootScope

    <!DOCTYPE html><html ng-app='myModule'><head lang="en"> <meta charset ...

  5. angular $scope.$watch

    在$scope内置的所有函数中,用得最多的可能就是$watch 函数了.当你的数据模型中某一部分发生变化时,$watch函数可以向你发出通知. 你可以监控单个对象的属性,也可以监控需要经过计算的结果( ...

  6. Angular Scope解析与应用

    Scope层级结构 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA== ...

  7. [Angular Directive] Assign a Structual Directive a Dynamic Context in Angular 2

     Just like passing in an array to *ngFor, you can pass in any value into your structural directive s ...

  8. Angular之 Scope和 Directive

    ---------------------------Scope-------------------------------- https://docs.angularjs.org/guide/sc ...

  9. angular指令大全

    这篇文章的案例都是来自官方,引用的cdn来自bootcss, 因为angular的官方网站被屏了, 所以要翻, 不过我把整个文档下回来了,方便大家下载可以点击: 打开下载英文版 angular的指令 ...

  10. Scope Directive

    ---------------------------Scope-------------------------------- https://docs.angularjs.org/guide/sc ...

随机推荐

  1. nginx 平滑升级tengine

    wget  http://tengine.taobao.org/download/tengine-1.5.1.tar.gz //下载Tengine1.5.1版本 tar zxvf tengine-1. ...

  2. 3D俄罗斯方块设计

    发布在博客:http://blog.sina.com.cn/s/blog_d38e811c0101cpis.html

  3. 【问题&解决】解决创建Android模拟器时提示"No system images installed for this target"的问题

    在创建Android模拟器时间发现提示“No system images installed for this target”问题,无法创建模拟器,如下图: 解决:经上网查证,发现原因在于CPU/AB ...

  4. Android配置----Eclipse+BlueStacks调试Android应用

    [声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/3 ...

  5. easyui 的 DataGrid View 使用

    easyui真是后台人员的宝呀,让不会前台的程序员,不用再用那些自己看着都恶心的表格了! 今天来说说easyui datagrid 的 数据表格详细展示表格,这个有趣多了! 先上图 然后是代码 $(' ...

  6. java的IO操作之--RandomAccessFile

    目标: 1)掌握RandomAccessFile类的作用. 2)用RandomAccessFile读取指定位置的数据. 具体内容 RandomAccessFile类的主要功能是完成随机读取功能,可以读 ...

  7. 一篇搞定RSA加密与SHA签名|与Java完全同步

    基础知识 什么是RSA?答:RSA是一种非对称加密算法,常用来对传输数据进行加密,配合上数字摘要算法,也可以进行文字签名. RSA加密中padding?答:padding即填充方式,由于RSA加密算法 ...

  8. Java 数据类型和变量

    1.1 基本类型与引用类型的区别 1.基本类型代表简单的数据类型,比如整数和字符,引用类型所引用的实例能表示任意一种复杂的数据类型. 2.基本类型仅表示数据类型,而引用类型所引用的实例除了表示复杂数据 ...

  9. Netty关闭客户端

    在启动客户端的时候,我们一般会 channelFuture.channel().closeFuture().sync(); 这是一段阻塞的代码,除非链路断了,否则是不会终止的,我们可以在handler ...

  10. Console的使用——Google Chrome代码调试

    Google Chrome控制台为开发者提供了网页和应用程序调试的几种方法,本文通过基本操作.控制台API.命令行API来介绍控制台的使用. 基本操作 1.开启控制台     可以通过下列三种方式开启 ...