欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

AngularJs1.x自定義指令獨立作用域的函數(shù)傳入?yún)?shù)方法

在定義指令的scope屬性如果設(shè)置成了{(lán)},那就成為了一個獨立作用域,如果要傳入一個方法,使用&,但是這里的傳參有點不一樣。

創(chuàng)新互聯(lián)建站堅持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站設(shè)計制作、成都網(wǎng)站設(shè)計、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時代的丹棱網(wǎng)站設(shè)計、移動媒體設(shè)計的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

先看下官網(wǎng)解釋:

& or &attr - provides a way to execute an expression in the context of the parent scope. If no attr name is specified then the attribute name is assumed to be the same as the local name. Given and widget definition of scope: { localFn:'&myAttr' }, then isolate scope property localFn will point to a function wrapper for the count = count + value expression. Often it's desirable to pass data from the isolated scope via an expression and to the parent scope, this can be done by passing a map of local variable names and values into the expression wrapper fn. For example, if the expression is increment(amount) then we can specify the amount value by calling the localFn as localFn({amount: 22}).

這里有個例子:

<!DOCTYPE html>
<html>
<head lang="en">
 <meta charset="UTF-8">
 <title></title>
</head>
<body ng-app="app1">
<div ng-controller="MyCtrl">
 <div ng-repeat="item in items" my-component isolated-expression-foo="updateItem(item,temp)">
 {{item|json}}
 </div>
</div>
</body>
<script src="../scripts/angular.js"></script>
<script>
 var myModule = angular.module('app1', [])
 .directive('myComponent', function () {
 return {
 restrict:'A',
 scope:{
 isolatedExpressionFoo:'&'
 },
 link:function(scope,element,attr) {
 scope.isolatedExpressionFoo();
 }
 };
 })
 .controller('MyCtrl', ['$scope', function ($scope) {
 $scope.items=[{id:1,value:"test"},{id:2,value:"TEst2"}];
 $scope.updateItem = function (item,temp) {
 console.log("Item param "+item.id);
 console.log("temp param " + temp);
 }
 }]);

</script>
</html>

以上這篇AngularJs1.x自定義指令獨立作用域的函數(shù)傳入?yún)?shù)方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持創(chuàng)新互聯(lián)。

當(dāng)前題目:AngularJs1.x自定義指令獨立作用域的函數(shù)傳入?yún)?shù)方法
網(wǎng)站網(wǎng)址:http://chinadenli.net/article0/ppcjoo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)、網(wǎng)站內(nèi)鏈、云服務(wù)器、域名注冊虛擬主機、定制開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)
亚洲精品国产主播一区| 亚洲欧美黑人一区二区| 亚洲一区二区精品国产av| 中文字幕一区久久综合| 久久精品中文扫妇内射| 欧美国产日产在线观看| 在线免费国产一区二区三区| 欧美野外在线刺激在线观看| 少妇丰满a一区二区三区| 久久精品a毛片看国产成人| 国产精品涩涩成人一区二区三区| 免费精品一区二区三区| 欧美激情一区=区三区| 中文字幕亚洲在线一区| 国产精品亚洲综合色区韩国| 欧美日韩在线第一页日韩| 欧美成人黄色一级视频| 日本精品理论在线观看| 激情亚洲内射一区二区三区| 99久久免费中文字幕| 国产一区日韩二区欧美| 夫妻性生活一级黄色录像| 日本av在线不卡一区| 东北女人的逼操的舒服吗| 一区二区三区18禁看| 亚洲欧美一二区日韩高清在线| 欧美高潮喷吹一区二区| 久久精品国产熟女精品| 亚洲av秘片一区二区三区| 国产精品欧美一区二区三区不卡| 日韩一级一片内射视频4k| 欧美美女视频在线免费看| 91精品视频全国免费| 欧美国产极品一区二区| 国产激情一区二区三区不卡| 欧美国产极品一区二区| 欧美尤物在线视频91| 91欧美日韩精品在线| 国产又大又猛又粗又长又爽| 日本精品啪啪一区二区三区| 麻豆剧果冻传媒一二三区|