Home >Web Front-end >JS Tutorial >Guide to using $scope method in angularJS_AngularJS

Guide to using $scope method in angularJS_AngularJS

WBOY
WBOYOriginal
2016-05-16 16:14:561252browse

复制代码 代码如下:





无标题文档




   

        {{item}} {{m}}

   


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

以上就是关于angularJS 中$scope方法使用指南的全部内容了,希望大家能够喜欢。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn