In Angular 1.5, there is no link and compile. So use if you transclude, you cannot access the fifth arguement in link function, which is transcludeFn. But in v1.5, you can access $transclude in controller. And what you can do for that is check whethe…
用户创建的UI成为其他UI的子控件的时候,默认情况下是不能拥有子控件的,给UI添加一个Named Slot,这个UI就可以拥有子控件 一.创建一个名为testNameSlot的UI,添加3个Named Slot,分别命名为:NamedSlot_Top.NamedSlot_Body.NamedSlot_Bottom. 二.在别的UI中把“testNameSlot”拖放进来,可以看到3个NamedSlot:NamedSlot_Top.NamedSlot_Body.NamedSlot_Bottom 三…
If you know ui-router, multi-transclude should be easy for you also. In previou Angular version <1.4, one diretive can only have one transclude element. But now in Angular 1.5, you can give each transclude element a name, then you can have multi-tran…
写在前面 最近在项目中遇到这样的一个前端的bug,在ng-repeat中绑定的图片,有一个晃动的特效,在手机端浏览的时候,图片有时候会正常展示,有时就展示不出来.当时猜测是因为angularjs与特效的那些代码加载的先后顺序造成的.有了这样的猜测,就有查找解决方案的方向了. 系列文章 [Angularjs]ng-select和ng-options [Angularjs]ng-show和ng-hide [Angularjs]视图和路由(一) [Angularjs]视图和路由(二) [Angular…
Note: Can use $dirty to check whether user has intracted with the form: https://docs.angularjs.org/api/ng/type/form.FormController Read More: http://www.yearofmoo.com/2014/05/how-to-use-ngmessages-in-angularjs.html https://egghead.io/lessons/angularj…
AngularJS 1.3 add $submitted for form, so you can use  $submitted  to track whether the submit event is trggered. Read More: https://egghead.io/lessons/angularjs-new-in-angular-1-3-updates-to-forms <!DOCTYPE html> <html> <head> <scrip…
Read More: http://www.linkplugapp.com/a/953215 https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub angular-hint helps us writing better Angular code and makes finding very common mistakes in our code base easier. For e…
getterSetter:  boolean value which determines whether or not to treat functions bound to ngModel as getters/setters to have greater control over your model. allowInvalid: boolean value which indicateds that the model can be set with values that did n…
<!DOCTYPE html> <html ng-app="app"> <head lang="en" > <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"…
angular.identity 函数返回本身的第一个参数.这个函数一般用于函数风格. ----------以上是官网对该接口的说明,只能说这个文档写得也太二,让人完全看不懂.要理解它的用途,可直接看以下代码: function getResult(fn, input) { //其实我们可以直接这样写: //return fn(input); 但这样写有个问题,如果传入的fn参数不是一个function类型,会导致出错. //官方推荐的写法如下: return (fn || angular.id…