Let's see how to track index when we use 'ngFor: #i = index, simple as that :) ...
分类:
其他好文 时间:
2016-04-07 06:58:11
阅读次数:
128
You can also use Promise for http: So for the service, you need to call toPromise() method: Then in your controller, you can get the Promise back: But ...
分类:
Web程序 时间:
2016-04-07 06:57:38
阅读次数:
122
angularjs中大多在指令之中操作DOM,现在遇到一个指令中无法获取DOM的特殊情况:vardirectiveCtrl=angular.module("directiveCtrl",[]);
directiveCtrl.controller("ctrlTwo",[‘$scope‘,function($scope){
$scope.name="me";
}]);
directiveCtrl.directive("num",function(){
r..
分类:
Web程序 时间:
2016-04-06 15:30:56
阅读次数:
720
很多时候我们需要用ajax提交post数据,angularjs与jq类似,也有封装好的post。 但是jQuery的post明显比angularjs的要简单一些,人性化一些。 两者看起来没什么区别,用angularjs的$http提交的数据,在php服务器端却无法通过$_REQUEST/$_POST ...
分类:
Web程序 时间:
2016-04-06 15:15:10
阅读次数:
220
Property Binding is bind property NOT attribute! So 'class' is attribute on DOM, but 'class.active' is an property. 'aria-label' is attribute, so need ...
分类:
其他好文 时间:
2016-04-06 07:05:16
阅读次数:
179
In Angular2, sometime we use @Output to pass data to parent component, then parent may pass the data down to another child component. When you want to ...
分类:
其他好文 时间:
2016-04-06 02:13:54
阅读次数:
222
前几天清明节放假三天,在家里闲着无聊,正好在网上找到了一个关于angular的教程,学习了一下angular的ui-router和ng-grid这两个模块,顺便模仿着做了一个小小的东西。代码已经上传到github上,地址在这里哟https://github.com/wwervin72/LeagueO ...
分类:
Web程序 时间:
2016-04-05 21:29:12
阅读次数:
391
When you want to access child component's method, you can use @ViewChild in the parent: Parent Component: Child Component: ...
分类:
数据库 时间:
2016-04-05 02:00:05
阅读次数:
292
作用域第一章 作用域和Digest(三)$eval - 在当前作用域的上下文中执行代码Angular有多种方式让你在当前作用域的上下文中执行代码。最简单的是$eval。传入一个函数当做其参数,然后将当前的作用域作为参数传给该函数,并执行它。然后它返回该函数的执行结果。$eval还有第二个可选的参数,它仅仅是被传递给将要执行的函数。有几个单元测试展示了我们如何使用$eval:test/scope_sp...
分类:
Web程序 时间:
2016-04-04 14:57:51
阅读次数:
316
AngularJS $scope里面的$watch(),$digest()和$apply()是AngularJS的核心函数,学习AngularJS必须理解这几个函数。 在绑定$scope中的变量到view的时候,AngularJS自动在内部创建一个"Watch"。"Watch"用于监听Angular ...
分类:
移动开发 时间:
2016-04-03 20:25:28
阅读次数:
172