rails-angularjs 1.4.9 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rails-angularjs/version.rb +1 -1
- data/vendor/assets/javascripts/angular-animate.js +296 -48
- data/vendor/assets/javascripts/angular-animate.min.js +52 -51
- data/vendor/assets/javascripts/angular-animate.min.js.map +3 -3
- data/vendor/assets/javascripts/angular-aria.js +51 -51
- data/vendor/assets/javascripts/angular-aria.min.js +10 -10
- data/vendor/assets/javascripts/angular-aria.min.js.map +2 -2
- data/vendor/assets/javascripts/angular-cookies.js +9 -8
- data/vendor/assets/javascripts/angular-cookies.min.js +2 -2
- data/vendor/assets/javascripts/angular-cookies.min.js.map +1 -1
- data/vendor/assets/javascripts/angular-loader.js +16 -3
- data/vendor/assets/javascripts/angular-loader.min.js +5 -5
- data/vendor/assets/javascripts/angular-loader.min.js.map +2 -2
- data/vendor/assets/javascripts/angular-message-format.js +2 -2
- data/vendor/assets/javascripts/angular-message-format.min.js +2 -2
- data/vendor/assets/javascripts/angular-messages.js +7 -5
- data/vendor/assets/javascripts/angular-messages.min.js +8 -8
- data/vendor/assets/javascripts/angular-messages.min.js.map +2 -2
- data/vendor/assets/javascripts/angular-mocks.js +323 -30
- data/vendor/assets/javascripts/angular-resource.js +116 -42
- data/vendor/assets/javascripts/angular-resource.min.js +11 -10
- data/vendor/assets/javascripts/angular-resource.min.js.map +3 -3
- data/vendor/assets/javascripts/angular-route.js +36 -11
- data/vendor/assets/javascripts/angular-route.min.js +11 -11
- data/vendor/assets/javascripts/angular-route.min.js.map +2 -2
- data/vendor/assets/javascripts/angular-sanitize.js +280 -246
- data/vendor/assets/javascripts/angular-sanitize.min.js +11 -12
- data/vendor/assets/javascripts/angular-sanitize.min.js.map +3 -3
- data/vendor/assets/javascripts/angular-scenario.js +1227 -456
- data/vendor/assets/javascripts/angular-touch.js +114 -12
- data/vendor/assets/javascripts/angular-touch.min.js +10 -9
- data/vendor/assets/javascripts/angular-touch.min.js.map +3 -3
- data/vendor/assets/javascripts/angular.js +1227 -456
- data/vendor/assets/javascripts/angular.min.js +302 -293
- data/vendor/assets/javascripts/angular.min.js.map +3 -3
- metadata +1 -1
@@ -1,16 +1,15 @@
|
|
1
1
|
/*
|
2
|
-
AngularJS v1.
|
3
|
-
(c) 2010-
|
2
|
+
AngularJS v1.5.0
|
3
|
+
(c) 2010-2016 Google, Inc. http://angularjs.org
|
4
4
|
License: MIT
|
5
5
|
*/
|
6
|
-
(function(
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
c){g.push("<a ");h.isDefined(b)&&g.push('target="',b,'" ');g.push('href="',a.replace(/"/g,"""),'">');k(c);g.push("</a>")}if(!c)return c;for(var m,l=c,g=[],n,p;m=l.match(f);)n=m[0],m[2]||m[4]||(n=(m[3]?"http://":"mailto:")+n),p=m.index,k(l.substr(0,p)),e(n,m[0].replace(d,"")),l=l.substring(p+m[0].length);k(l);return a(g.join(""))}}])})(window,window.angular);
|
6
|
+
(function(A,e,B){'use strict';function C(a){var c=[];v(c,e.noop).chars(a);return c.join("")}function h(a,c){var b={},d=a.split(","),l;for(l=0;l<d.length;l++)b[c?e.lowercase(d[l]):d[l]]=!0;return b}function D(a,c){null===a||a===B?a="":"string"!==typeof a&&(a=""+a);g.innerHTML=a;var b=5;do{if(0===b)throw w("uinput");b--;11>=document.documentMode&&n(g);a=g.innerHTML;g.innerHTML=a}while(a!==g.innerHTML);for(b=g.firstChild;b;){switch(b.nodeType){case 1:c.start(b.nodeName.toLowerCase(),E(b.attributes));
|
7
|
+
break;case 3:c.chars(b.textContent)}var d;if(!(d=b.firstChild)&&(1==b.nodeType&&c.end(b.nodeName.toLowerCase()),d=b.nextSibling,!d))for(;null==d;){b=b.parentNode;if(b===g)break;d=b.nextSibling;1==b.nodeType&&c.end(b.nodeName.toLowerCase())}b=d}for(;b=g.firstChild;)g.removeChild(b)}function E(a){for(var c={},b=0,d=a.length;b<d;b++){var l=a[b];c[l.name]=l.value}return c}function x(a){return a.replace(/&/g,"&").replace(F,function(a){var b=a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(b-55296)+
|
8
|
+
(a-56320)+65536)+";"}).replace(G,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}function v(a,c){var b=!1,d=e.bind(a,a.push);return{start:function(a,f){a=e.lowercase(a);!b&&H[a]&&(b=a);b||!0!==t[a]||(d("<"),d(a),e.forEach(f,function(b,f){var g=e.lowercase(f),h="img"===a&&"src"===g||"background"===g;!0!==I[g]||!0===y[g]&&!c(b,h)||(d(" "),d(f),d('="'),d(x(b)),d('"'))}),d(">"))},end:function(a){a=e.lowercase(a);b||!0!==t[a]||!0===z[a]||(d("</"),d(a),d(">"));a==
|
9
|
+
b&&(b=!1)},chars:function(a){b||d(x(a))}}}function n(a){if(a.nodeType===Node.ELEMENT_NODE)for(var c=a.attributes,b=0,d=c.length;b<d;b++){var e=c[b],f=e.name.toLowerCase();if("xmlns:ns1"===f||0===f.indexOf("ns1:"))a.removeAttributeNode(e),b--,d--}(c=a.firstChild)&&n(c);(c=a.nextSibling)&&n(c)}var w=e.$$minErr("$sanitize"),F=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,G=/([^\#-~ |!])/g,z=h("area,br,col,hr,img,wbr"),q=h("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),k=h("rp,rt"),u=e.extend({},k,q),q=e.extend({},
|
10
|
+
q,h("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),k=e.extend({},k,h("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),J=h("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),
|
11
|
+
H=h("script,style"),t=e.extend({},z,q,k,u),y=h("background,cite,href,longdesc,src,xlink:href"),u=h("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),k=h("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",
|
12
|
+
!0),I=e.extend({},y,k,u),g;(function(a){if(a.document&&a.document.implementation)a=a.document.implementation.createHTMLDocument("inert");else throw w("noinert");var c=(a.documentElement||a.getDocumentElement()).getElementsByTagName("body");1===c.length?g=c[0]:(c=a.createElement("html"),g=a.createElement("body"),c.appendChild(g),a.appendChild(c))})(A);e.module("ngSanitize",[]).provider("$sanitize",function(){var a=!1;this.$get=["$$sanitizeUri",function(c){a&&e.extend(t,J);return function(a){var d=
|
13
|
+
[];D(a,v(d,function(a,b){return!/^unsafe:/.test(c(a,b))}));return d.join("")}}];this.enableSvg=function(c){return e.isDefined(c)?(a=c,this):a}});e.module("ngSanitize").filter("linky",["$sanitize",function(a){var c=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,b=/^mailto:/i,d=e.$$minErr("linky"),g=e.isString;return function(f,h,m){function k(a){a&&p.push(C(a))}function q(a,b){var c;p.push("<a ");e.isFunction(m)&&(m=m(a));if(e.isObject(m))for(c in m)p.push(c+
|
14
|
+
'="'+m[c]+'" ');else m={};!e.isDefined(h)||"target"in m||p.push('target="',h,'" ');p.push('href="',a.replace(/"/g,"""),'">');k(b);p.push("</a>")}if(null==f||""===f)return f;if(!g(f))throw d("notstring",f);for(var r=f,p=[],s,n;f=r.match(c);)s=f[0],f[2]||f[4]||(s=(f[3]?"http://":"mailto:")+s),n=f.index,k(r.substr(0,n)),q(s,f[0].replace(b,"")),r=r.substring(n+f[0].length);k(r);return a(p.join(""))}}])})(window,window.angular);
|
16
15
|
//# sourceMappingURL=angular-sanitize.min.js.map
|
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"version":3,
|
3
3
|
"file":"angular-sanitize.min.js",
|
4
|
-
"lineCount":
|
5
|
-
"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,
|
4
|
+
"lineCount":14,
|
5
|
+
"mappings":"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",
|
6
6
|
"sources":["angular-sanitize.js"],
|
7
|
-
"names":["window","angular","undefined","sanitizeText","chars","buf","htmlSanitizeWriter","writer","noop","join","
|
7
|
+
"names":["window","angular","undefined","sanitizeText","chars","buf","htmlSanitizeWriter","writer","noop","join","toMap","str","lowercaseKeys","obj","items","split","i","length","lowercase","htmlParser","html","handler","inertBodyElement","innerHTML","mXSSAttempts","$sanitizeMinErr","document","documentMode","stripCustomNsAttrs","node","firstChild","nodeType","start","nodeName","toLowerCase","attrToMap","attributes","textContent","nextNode","end","nextSibling","parentNode","removeChild","attrs","map","ii","attr","name","value","encodeEntities","replace","SURROGATE_PAIR_REGEXP","hi","charCodeAt","low","NON_ALPHANUMERIC_REGEXP","uriValidator","ignoreCurrentElement","out","bind","push","tag","blockedElements","validElements","forEach","key","lkey","isImage","validAttrs","uriAttrs","voidElements","Node","ELEMENT_NODE","l","attrNode","attrName","indexOf","removeAttributeNode","$$minErr","optionalEndTagBlockElements","optionalEndTagInlineElements","optionalEndTagElements","extend","blockElements","inlineElements","svgElements","htmlAttrs","svgAttrs","implementation","doc","createHTMLDocument","bodyElements","getElementsByTagName","documentElement","getDocumentElement","createElement","appendChild","module","provider","$SanitizeProvider","svgEnabled","$get","$$sanitizeUri","uri","test","enableSvg","this.enableSvg","isDefined","filter","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","linkyMinErr","isString","text","target","addText","addLink","url","isFunction","isObject","raw","match","index","substr","substring"]
|
8
8
|
}
|
@@ -9190,8 +9190,8 @@ return jQuery;
|
|
9190
9190
|
}));
|
9191
9191
|
|
9192
9192
|
/**
|
9193
|
-
* @license AngularJS v1.
|
9194
|
-
* (c) 2010-
|
9193
|
+
* @license AngularJS v1.5.0
|
9194
|
+
* (c) 2010-2016 Google, Inc. http://angularjs.org
|
9195
9195
|
* License: MIT
|
9196
9196
|
*/
|
9197
9197
|
(function(window, document){
|
@@ -9249,7 +9249,7 @@ function minErr(module, ErrorConstructor) {
|
|
9249
9249
|
return match;
|
9250
9250
|
});
|
9251
9251
|
|
9252
|
-
message += '\nhttp://errors.angularjs.org/1.
|
9252
|
+
message += '\nhttp://errors.angularjs.org/1.5.0/' +
|
9253
9253
|
(module ? module + '/' : '') + code;
|
9254
9254
|
|
9255
9255
|
for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
|
@@ -9380,29 +9380,9 @@ var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;
|
|
9380
9380
|
// This is used so that it's possible for internal tests to create mock ValidityStates.
|
9381
9381
|
var VALIDITY_STATE_PROPERTY = 'validity';
|
9382
9382
|
|
9383
|
-
/**
|
9384
|
-
* @ngdoc function
|
9385
|
-
* @name angular.lowercase
|
9386
|
-
* @module ng
|
9387
|
-
* @kind function
|
9388
|
-
*
|
9389
|
-
* @description Converts the specified string to lowercase.
|
9390
|
-
* @param {string} string String to be converted to lowercase.
|
9391
|
-
* @returns {string} Lowercased string.
|
9392
|
-
*/
|
9393
|
-
var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};
|
9394
9383
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
9395
9384
|
|
9396
|
-
|
9397
|
-
* @ngdoc function
|
9398
|
-
* @name angular.uppercase
|
9399
|
-
* @module ng
|
9400
|
-
* @kind function
|
9401
|
-
*
|
9402
|
-
* @description Converts the specified string to uppercase.
|
9403
|
-
* @param {string} string String to be converted to uppercase.
|
9404
|
-
* @returns {string} Uppercased string.
|
9405
|
-
*/
|
9385
|
+
var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};
|
9406
9386
|
var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};
|
9407
9387
|
|
9408
9388
|
|
@@ -9422,7 +9402,7 @@ var manualUppercase = function(s) {
|
|
9422
9402
|
|
9423
9403
|
// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
|
9424
9404
|
// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
|
9425
|
-
// with correct but slower alternatives.
|
9405
|
+
// with correct but slower alternatives. See https://github.com/angular/angular.js/issues/11387
|
9426
9406
|
if ('i' !== 'I'.toLowerCase()) {
|
9427
9407
|
lowercase = manualLowercase;
|
9428
9408
|
uppercase = manualUppercase;
|
@@ -9465,7 +9445,7 @@ function isArrayLike(obj) {
|
|
9465
9445
|
|
9466
9446
|
// arrays, strings and jQuery/jqLite objects are array like
|
9467
9447
|
// * jqLite is either the jQuery or jqLite constructor function
|
9468
|
-
// * we have to check the
|
9448
|
+
// * we have to check the existence of jqLite first as this method is called
|
9469
9449
|
// via the forEach method when constructing the jqLite object in the first place
|
9470
9450
|
if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true;
|
9471
9451
|
|
@@ -9574,7 +9554,7 @@ function forEachSorted(obj, iterator, context) {
|
|
9574
9554
|
* @returns {function(*, string)}
|
9575
9555
|
*/
|
9576
9556
|
function reverseParams(iteratorFn) {
|
9577
|
-
return function(value, key) {
|
9557
|
+
return function(value, key) {iteratorFn(key, value);};
|
9578
9558
|
}
|
9579
9559
|
|
9580
9560
|
/**
|
@@ -9945,6 +9925,10 @@ function isTypedArray(value) {
|
|
9945
9925
|
return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));
|
9946
9926
|
}
|
9947
9927
|
|
9928
|
+
function isArrayBuffer(obj) {
|
9929
|
+
return toString.call(obj) === '[object ArrayBuffer]';
|
9930
|
+
}
|
9931
|
+
|
9948
9932
|
|
9949
9933
|
var trim = function(value) {
|
9950
9934
|
return isString(value) ? value.trim() : value;
|
@@ -9982,7 +9966,7 @@ function isElement(node) {
|
|
9982
9966
|
* @returns {object} in the form of {key1:true, key2:true, ...}
|
9983
9967
|
*/
|
9984
9968
|
function makeMap(str) {
|
9985
|
-
var obj = {}, items = str.split(
|
9969
|
+
var obj = {}, items = str.split(','), i;
|
9986
9970
|
for (i = 0; i < items.length; i++) {
|
9987
9971
|
obj[items[i]] = true;
|
9988
9972
|
}
|
@@ -10069,7 +10053,7 @@ function copy(source, destination) {
|
|
10069
10053
|
var stackDest = [];
|
10070
10054
|
|
10071
10055
|
if (destination) {
|
10072
|
-
if (isTypedArray(destination)) {
|
10056
|
+
if (isTypedArray(destination) || isArrayBuffer(destination)) {
|
10073
10057
|
throw ngMinErr('cpta', "Can't copy! TypedArray destination cannot be mutated.");
|
10074
10058
|
}
|
10075
10059
|
if (source === destination) {
|
@@ -10143,22 +10127,10 @@ function copy(source, destination) {
|
|
10143
10127
|
}
|
10144
10128
|
|
10145
10129
|
var needsRecurse = false;
|
10146
|
-
var destination;
|
10130
|
+
var destination = copyType(source);
|
10147
10131
|
|
10148
|
-
if (
|
10149
|
-
destination = [];
|
10150
|
-
needsRecurse = true;
|
10151
|
-
} else if (isTypedArray(source)) {
|
10152
|
-
destination = new source.constructor(source);
|
10153
|
-
} else if (isDate(source)) {
|
10154
|
-
destination = new Date(source.getTime());
|
10155
|
-
} else if (isRegExp(source)) {
|
10156
|
-
destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]);
|
10157
|
-
destination.lastIndex = source.lastIndex;
|
10158
|
-
} else if (isFunction(source.cloneNode)) {
|
10159
|
-
destination = source.cloneNode(true);
|
10160
|
-
} else {
|
10161
|
-
destination = Object.create(getPrototypeOf(source));
|
10132
|
+
if (destination === undefined) {
|
10133
|
+
destination = isArray(source) ? [] : Object.create(getPrototypeOf(source));
|
10162
10134
|
needsRecurse = true;
|
10163
10135
|
}
|
10164
10136
|
|
@@ -10169,6 +10141,45 @@ function copy(source, destination) {
|
|
10169
10141
|
? copyRecurse(source, destination)
|
10170
10142
|
: destination;
|
10171
10143
|
}
|
10144
|
+
|
10145
|
+
function copyType(source) {
|
10146
|
+
switch (toString.call(source)) {
|
10147
|
+
case '[object Int8Array]':
|
10148
|
+
case '[object Int16Array]':
|
10149
|
+
case '[object Int32Array]':
|
10150
|
+
case '[object Float32Array]':
|
10151
|
+
case '[object Float64Array]':
|
10152
|
+
case '[object Uint8Array]':
|
10153
|
+
case '[object Uint8ClampedArray]':
|
10154
|
+
case '[object Uint16Array]':
|
10155
|
+
case '[object Uint32Array]':
|
10156
|
+
return new source.constructor(copyElement(source.buffer));
|
10157
|
+
|
10158
|
+
case '[object ArrayBuffer]':
|
10159
|
+
//Support: IE10
|
10160
|
+
if (!source.slice) {
|
10161
|
+
var copied = new ArrayBuffer(source.byteLength);
|
10162
|
+
new Uint8Array(copied).set(new Uint8Array(source));
|
10163
|
+
return copied;
|
10164
|
+
}
|
10165
|
+
return source.slice(0);
|
10166
|
+
|
10167
|
+
case '[object Boolean]':
|
10168
|
+
case '[object Number]':
|
10169
|
+
case '[object String]':
|
10170
|
+
case '[object Date]':
|
10171
|
+
return new source.constructor(source.valueOf());
|
10172
|
+
|
10173
|
+
case '[object RegExp]':
|
10174
|
+
var re = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]);
|
10175
|
+
re.lastIndex = source.lastIndex;
|
10176
|
+
return re;
|
10177
|
+
}
|
10178
|
+
|
10179
|
+
if (isFunction(source.cloneNode)) {
|
10180
|
+
return source.cloneNode(true);
|
10181
|
+
}
|
10182
|
+
}
|
10172
10183
|
}
|
10173
10184
|
|
10174
10185
|
/**
|
@@ -10231,38 +10242,37 @@ function equals(o1, o2) {
|
|
10231
10242
|
if (o1 === null || o2 === null) return false;
|
10232
10243
|
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
|
10233
10244
|
var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
|
10234
|
-
if (t1 == t2) {
|
10235
|
-
if (
|
10236
|
-
if (isArray(
|
10237
|
-
|
10238
|
-
|
10239
|
-
for (key = 0; key < length; key++) {
|
10240
|
-
if (!equals(o1[key], o2[key])) return false;
|
10241
|
-
}
|
10242
|
-
return true;
|
10243
|
-
}
|
10244
|
-
} else if (isDate(o1)) {
|
10245
|
-
if (!isDate(o2)) return false;
|
10246
|
-
return equals(o1.getTime(), o2.getTime());
|
10247
|
-
} else if (isRegExp(o1)) {
|
10248
|
-
return isRegExp(o2) ? o1.toString() == o2.toString() : false;
|
10249
|
-
} else {
|
10250
|
-
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
|
10251
|
-
isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
|
10252
|
-
keySet = createMap();
|
10253
|
-
for (key in o1) {
|
10254
|
-
if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
|
10245
|
+
if (t1 == t2 && t1 == 'object') {
|
10246
|
+
if (isArray(o1)) {
|
10247
|
+
if (!isArray(o2)) return false;
|
10248
|
+
if ((length = o1.length) == o2.length) {
|
10249
|
+
for (key = 0; key < length; key++) {
|
10255
10250
|
if (!equals(o1[key], o2[key])) return false;
|
10256
|
-
keySet[key] = true;
|
10257
|
-
}
|
10258
|
-
for (key in o2) {
|
10259
|
-
if (!(key in keySet) &&
|
10260
|
-
key.charAt(0) !== '$' &&
|
10261
|
-
isDefined(o2[key]) &&
|
10262
|
-
!isFunction(o2[key])) return false;
|
10263
10251
|
}
|
10264
10252
|
return true;
|
10265
10253
|
}
|
10254
|
+
} else if (isDate(o1)) {
|
10255
|
+
if (!isDate(o2)) return false;
|
10256
|
+
return equals(o1.getTime(), o2.getTime());
|
10257
|
+
} else if (isRegExp(o1)) {
|
10258
|
+
if (!isRegExp(o2)) return false;
|
10259
|
+
return o1.toString() == o2.toString();
|
10260
|
+
} else {
|
10261
|
+
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
|
10262
|
+
isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
|
10263
|
+
keySet = createMap();
|
10264
|
+
for (key in o1) {
|
10265
|
+
if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
|
10266
|
+
if (!equals(o1[key], o2[key])) return false;
|
10267
|
+
keySet[key] = true;
|
10268
|
+
}
|
10269
|
+
for (key in o2) {
|
10270
|
+
if (!(key in keySet) &&
|
10271
|
+
key.charAt(0) !== '$' &&
|
10272
|
+
isDefined(o2[key]) &&
|
10273
|
+
!isFunction(o2[key])) return false;
|
10274
|
+
}
|
10275
|
+
return true;
|
10266
10276
|
}
|
10267
10277
|
}
|
10268
10278
|
return false;
|
@@ -10439,7 +10449,7 @@ function toJsonReplacer(key, value) {
|
|
10439
10449
|
* @returns {string|undefined} JSON-ified string representing `obj`.
|
10440
10450
|
*/
|
10441
10451
|
function toJson(obj, pretty) {
|
10442
|
-
if (
|
10452
|
+
if (isUndefined(obj)) return undefined;
|
10443
10453
|
if (!isNumber(pretty)) {
|
10444
10454
|
pretty = pretty ? 2 : null;
|
10445
10455
|
}
|
@@ -10466,7 +10476,10 @@ function fromJson(json) {
|
|
10466
10476
|
}
|
10467
10477
|
|
10468
10478
|
|
10479
|
+
var ALL_COLONS = /:/g;
|
10469
10480
|
function timezoneToOffset(timezone, fallback) {
|
10481
|
+
// IE/Edge do not "understand" colon (`:`) in timezone
|
10482
|
+
timezone = timezone.replace(ALL_COLONS, '');
|
10470
10483
|
var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
|
10471
10484
|
return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
|
10472
10485
|
}
|
@@ -10481,8 +10494,9 @@ function addDateMinutes(date, minutes) {
|
|
10481
10494
|
|
10482
10495
|
function convertTimezoneToLocal(date, timezone, reverse) {
|
10483
10496
|
reverse = reverse ? -1 : 1;
|
10484
|
-
var
|
10485
|
-
|
10497
|
+
var dateTimezoneOffset = date.getTimezoneOffset();
|
10498
|
+
var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
|
10499
|
+
return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));
|
10486
10500
|
}
|
10487
10501
|
|
10488
10502
|
|
@@ -10501,7 +10515,7 @@ function startingTag(element) {
|
|
10501
10515
|
return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
|
10502
10516
|
elemHtml.
|
10503
10517
|
match(/^(<[^>]+>)/)[1].
|
10504
|
-
replace(/^<([\w\-]+)/, function(match, nodeName) {
|
10518
|
+
replace(/^<([\w\-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});
|
10505
10519
|
} catch (e) {
|
10506
10520
|
return lowercase(elemHtml);
|
10507
10521
|
}
|
@@ -10944,7 +10958,6 @@ function snake_case(name, separator) {
|
|
10944
10958
|
}
|
10945
10959
|
|
10946
10960
|
var bindJQueryFired = false;
|
10947
|
-
var skipDestroyOnNextJQueryCleanData;
|
10948
10961
|
function bindJQuery() {
|
10949
10962
|
var originalCleanData;
|
10950
10963
|
|
@@ -10978,15 +10991,11 @@ function bindJQuery() {
|
|
10978
10991
|
originalCleanData = jQuery.cleanData;
|
10979
10992
|
jQuery.cleanData = function(elems) {
|
10980
10993
|
var events;
|
10981
|
-
|
10982
|
-
|
10983
|
-
|
10984
|
-
|
10985
|
-
jQuery(elem).triggerHandler('$destroy');
|
10986
|
-
}
|
10994
|
+
for (var i = 0, elem; (elem = elems[i]) != null; i++) {
|
10995
|
+
events = jQuery._data(elem, "events");
|
10996
|
+
if (events && events.$destroy) {
|
10997
|
+
jQuery(elem).triggerHandler('$destroy');
|
10987
10998
|
}
|
10988
|
-
} else {
|
10989
|
-
skipDestroyOnNextJQueryCleanData = false;
|
10990
10999
|
}
|
10991
11000
|
originalCleanData(elems);
|
10992
11001
|
};
|
@@ -11386,6 +11395,19 @@ function setupModuleLoader(window) {
|
|
11386
11395
|
*/
|
11387
11396
|
directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),
|
11388
11397
|
|
11398
|
+
/**
|
11399
|
+
* @ngdoc method
|
11400
|
+
* @name angular.Module#component
|
11401
|
+
* @module ng
|
11402
|
+
* @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp)
|
11403
|
+
* @param {Object} options Component definition object (a simplified
|
11404
|
+
* {@link ng.$compile#directive-definition-object directive definition object})
|
11405
|
+
*
|
11406
|
+
* @description
|
11407
|
+
* See {@link ng.$compileProvider#component $compileProvider.component()}.
|
11408
|
+
*/
|
11409
|
+
component: invokeLaterAndSetModuleName('$compileProvider', 'component'),
|
11410
|
+
|
11389
11411
|
/**
|
11390
11412
|
* @ngdoc method
|
11391
11413
|
* @name angular.Module#config
|
@@ -11544,6 +11566,7 @@ function toDebugString(obj) {
|
|
11544
11566
|
$BrowserProvider,
|
11545
11567
|
$CacheFactoryProvider,
|
11546
11568
|
$ControllerProvider,
|
11569
|
+
$DateProvider,
|
11547
11570
|
$DocumentProvider,
|
11548
11571
|
$ExceptionHandlerProvider,
|
11549
11572
|
$FilterProvider,
|
@@ -11593,11 +11616,11 @@ function toDebugString(obj) {
|
|
11593
11616
|
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
|
11594
11617
|
*/
|
11595
11618
|
var version = {
|
11596
|
-
full: '1.
|
11619
|
+
full: '1.5.0', // all of these placeholder strings will be replaced by grunt's
|
11597
11620
|
major: 1, // package task
|
11598
|
-
minor:
|
11599
|
-
dot:
|
11600
|
-
codeName: '
|
11621
|
+
minor: 5,
|
11622
|
+
dot: 0,
|
11623
|
+
codeName: 'ennoblement-facilitation'
|
11601
11624
|
};
|
11602
11625
|
|
11603
11626
|
|
@@ -11936,6 +11959,12 @@ function jqLiteHasData(node) {
|
|
11936
11959
|
return false;
|
11937
11960
|
}
|
11938
11961
|
|
11962
|
+
function jqLiteCleanData(nodes) {
|
11963
|
+
for (var i = 0, ii = nodes.length; i < ii; i++) {
|
11964
|
+
jqLiteRemoveData(nodes[i]);
|
11965
|
+
}
|
11966
|
+
}
|
11967
|
+
|
11939
11968
|
function jqLiteBuildFragment(html, context) {
|
11940
11969
|
var tmp, tag, wrap,
|
11941
11970
|
fragment = context.createDocumentFragment(),
|
@@ -11988,6 +12017,16 @@ function jqLiteParseHTML(html, context) {
|
|
11988
12017
|
return [];
|
11989
12018
|
}
|
11990
12019
|
|
12020
|
+
function jqLiteWrapNode(node, wrapper) {
|
12021
|
+
var parent = node.parentNode;
|
12022
|
+
|
12023
|
+
if (parent) {
|
12024
|
+
parent.replaceChild(wrapper, node);
|
12025
|
+
}
|
12026
|
+
|
12027
|
+
wrapper.appendChild(node);
|
12028
|
+
}
|
12029
|
+
|
11991
12030
|
|
11992
12031
|
// IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259.
|
11993
12032
|
var jqLiteContains = Node.prototype.contains || function(arg) {
|
@@ -12238,7 +12277,7 @@ function jqLiteRemove(element, keepData) {
|
|
12238
12277
|
function jqLiteDocumentLoaded(action, win) {
|
12239
12278
|
win = win || window;
|
12240
12279
|
if (win.document.readyState === 'complete') {
|
12241
|
-
// Force the action to be run async for consistent
|
12280
|
+
// Force the action to be run async for consistent behavior
|
12242
12281
|
// from the action's point of view
|
12243
12282
|
// i.e. it will definitely not be in a $apply
|
12244
12283
|
win.setTimeout(action);
|
@@ -12324,7 +12363,8 @@ function getAliasedAttrName(name) {
|
|
12324
12363
|
forEach({
|
12325
12364
|
data: jqLiteData,
|
12326
12365
|
removeData: jqLiteRemoveData,
|
12327
|
-
hasData: jqLiteHasData
|
12366
|
+
hasData: jqLiteHasData,
|
12367
|
+
cleanData: jqLiteCleanData
|
12328
12368
|
}, function(fn, name) {
|
12329
12369
|
JQLite[name] = fn;
|
12330
12370
|
});
|
@@ -12679,12 +12719,7 @@ forEach({
|
|
12679
12719
|
},
|
12680
12720
|
|
12681
12721
|
wrap: function(element, wrapNode) {
|
12682
|
-
|
12683
|
-
var parent = element.parentNode;
|
12684
|
-
if (parent) {
|
12685
|
-
parent.replaceChild(wrapNode, element);
|
12686
|
-
}
|
12687
|
-
wrapNode.appendChild(element);
|
12722
|
+
jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]);
|
12688
12723
|
},
|
12689
12724
|
|
12690
12725
|
remove: jqLiteRemove,
|
@@ -12962,17 +12997,23 @@ var $$HashMapProvider = [function() {
|
|
12962
12997
|
* Implicit module which gets automatically added to each {@link auto.$injector $injector}.
|
12963
12998
|
*/
|
12964
12999
|
|
13000
|
+
var ARROW_ARG = /^([^\(]+?)=>/;
|
12965
13001
|
var FN_ARGS = /^[^\(]*\(\s*([^\)]*)\)/m;
|
12966
13002
|
var FN_ARG_SPLIT = /,/;
|
12967
13003
|
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
|
12968
13004
|
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
|
12969
13005
|
var $injectorMinErr = minErr('$injector');
|
12970
13006
|
|
13007
|
+
function extractArgs(fn) {
|
13008
|
+
var fnText = fn.toString().replace(STRIP_COMMENTS, ''),
|
13009
|
+
args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);
|
13010
|
+
return args;
|
13011
|
+
}
|
13012
|
+
|
12971
13013
|
function anonFn(fn) {
|
12972
13014
|
// For anonymous functions, showing at the very least the function signature can help in
|
12973
13015
|
// debugging.
|
12974
|
-
var
|
12975
|
-
args = fnText.match(FN_ARGS);
|
13016
|
+
var args = extractArgs(fn);
|
12976
13017
|
if (args) {
|
12977
13018
|
return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')';
|
12978
13019
|
}
|
@@ -12981,7 +13022,6 @@ function anonFn(fn) {
|
|
12981
13022
|
|
12982
13023
|
function annotate(fn, strictDi, name) {
|
12983
13024
|
var $inject,
|
12984
|
-
fnText,
|
12985
13025
|
argDecl,
|
12986
13026
|
last;
|
12987
13027
|
|
@@ -12996,8 +13036,7 @@ function annotate(fn, strictDi, name) {
|
|
12996
13036
|
throw $injectorMinErr('strictdi',
|
12997
13037
|
'{0} is not using explicit annotation and cannot be invoked in strict mode', name);
|
12998
13038
|
}
|
12999
|
-
|
13000
|
-
argDecl = fnText.match(FN_ARGS);
|
13039
|
+
argDecl = extractArgs(fn);
|
13001
13040
|
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
|
13002
13041
|
arg.replace(FN_ARG, function(all, underscore, name) {
|
13003
13042
|
$inject.push(name);
|
@@ -13387,8 +13426,20 @@ function annotate(fn, strictDi, name) {
|
|
13387
13426
|
*
|
13388
13427
|
* Register a **service constructor**, which will be invoked with `new` to create the service
|
13389
13428
|
* instance.
|
13390
|
-
* This is short for registering a service where its provider's `$get` property is
|
13391
|
-
*
|
13429
|
+
* This is short for registering a service where its provider's `$get` property is a factory
|
13430
|
+
* function that returns an instance instantiated by the injector from the service constructor
|
13431
|
+
* function.
|
13432
|
+
*
|
13433
|
+
* Internally it looks a bit like this:
|
13434
|
+
*
|
13435
|
+
* ```
|
13436
|
+
* {
|
13437
|
+
* $get: function() {
|
13438
|
+
* return $injector.instantiate(constructor);
|
13439
|
+
* }
|
13440
|
+
* }
|
13441
|
+
* ```
|
13442
|
+
*
|
13392
13443
|
*
|
13393
13444
|
* You should use {@link auto.$provide#service $provide.service(class)} if you define your service
|
13394
13445
|
* as a type/class.
|
@@ -13538,14 +13589,19 @@ function createInjector(modulesToLoad, strictDi) {
|
|
13538
13589
|
throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- '));
|
13539
13590
|
})),
|
13540
13591
|
instanceCache = {},
|
13541
|
-
|
13592
|
+
protoInstanceInjector =
|
13542
13593
|
createInternalInjector(instanceCache, function(serviceName, caller) {
|
13543
13594
|
var provider = providerInjector.get(serviceName + providerSuffix, caller);
|
13544
|
-
return instanceInjector.invoke(
|
13545
|
-
|
13546
|
-
|
13595
|
+
return instanceInjector.invoke(
|
13596
|
+
provider.$get, provider, undefined, serviceName);
|
13597
|
+
}),
|
13598
|
+
instanceInjector = protoInstanceInjector;
|
13547
13599
|
|
13548
|
-
|
13600
|
+
providerCache['$injector' + providerSuffix] = { $get: valueFn(protoInstanceInjector) };
|
13601
|
+
var runBlocks = loadModules(modulesToLoad);
|
13602
|
+
instanceInjector = protoInstanceInjector.get('$injector');
|
13603
|
+
instanceInjector.strictDi = strictDi;
|
13604
|
+
forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); });
|
13549
13605
|
|
13550
13606
|
return instanceInjector;
|
13551
13607
|
|
@@ -13695,48 +13751,67 @@ function createInjector(modulesToLoad, strictDi) {
|
|
13695
13751
|
}
|
13696
13752
|
}
|
13697
13753
|
|
13698
|
-
function invoke(fn, self, locals, serviceName) {
|
13699
|
-
if (typeof locals === 'string') {
|
13700
|
-
serviceName = locals;
|
13701
|
-
locals = null;
|
13702
|
-
}
|
13703
13754
|
|
13755
|
+
function injectionArgs(fn, locals, serviceName) {
|
13704
13756
|
var args = [],
|
13705
|
-
$inject = createInjector.$$annotate(fn, strictDi, serviceName)
|
13706
|
-
length, i,
|
13707
|
-
key;
|
13757
|
+
$inject = createInjector.$$annotate(fn, strictDi, serviceName);
|
13708
13758
|
|
13709
|
-
for (i = 0, length = $inject.length; i < length; i++) {
|
13710
|
-
key = $inject[i];
|
13759
|
+
for (var i = 0, length = $inject.length; i < length; i++) {
|
13760
|
+
var key = $inject[i];
|
13711
13761
|
if (typeof key !== 'string') {
|
13712
13762
|
throw $injectorMinErr('itkn',
|
13713
13763
|
'Incorrect injection token! Expected service name as string, got {0}', key);
|
13714
13764
|
}
|
13715
|
-
args.push(
|
13716
|
-
|
13717
|
-
|
13718
|
-
|
13719
|
-
|
13765
|
+
args.push(locals && locals.hasOwnProperty(key) ? locals[key] :
|
13766
|
+
getService(key, serviceName));
|
13767
|
+
}
|
13768
|
+
return args;
|
13769
|
+
}
|
13770
|
+
|
13771
|
+
function isClass(func) {
|
13772
|
+
// IE 9-11 do not support classes and IE9 leaks with the code below.
|
13773
|
+
if (msie <= 11) {
|
13774
|
+
return false;
|
13775
|
+
}
|
13776
|
+
// Workaround for MS Edge.
|
13777
|
+
// Check https://connect.microsoft.com/IE/Feedback/Details/2211653
|
13778
|
+
return typeof func === 'function'
|
13779
|
+
&& /^(?:class\s|constructor\()/.test(Function.prototype.toString.call(func));
|
13780
|
+
}
|
13781
|
+
|
13782
|
+
function invoke(fn, self, locals, serviceName) {
|
13783
|
+
if (typeof locals === 'string') {
|
13784
|
+
serviceName = locals;
|
13785
|
+
locals = null;
|
13720
13786
|
}
|
13787
|
+
|
13788
|
+
var args = injectionArgs(fn, locals, serviceName);
|
13721
13789
|
if (isArray(fn)) {
|
13722
|
-
fn = fn[length];
|
13790
|
+
fn = fn[fn.length - 1];
|
13723
13791
|
}
|
13724
13792
|
|
13725
|
-
|
13726
|
-
|
13727
|
-
|
13793
|
+
if (!isClass(fn)) {
|
13794
|
+
// http://jsperf.com/angularjs-invoke-apply-vs-switch
|
13795
|
+
// #5388
|
13796
|
+
return fn.apply(self, args);
|
13797
|
+
} else {
|
13798
|
+
args.unshift(null);
|
13799
|
+
return new (Function.prototype.bind.apply(fn, args))();
|
13800
|
+
}
|
13728
13801
|
}
|
13729
13802
|
|
13803
|
+
|
13730
13804
|
function instantiate(Type, locals, serviceName) {
|
13731
13805
|
// Check if Type is annotated and use just the given function at n-1 as parameter
|
13732
13806
|
// e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
|
13733
|
-
|
13734
|
-
var
|
13735
|
-
|
13736
|
-
|
13737
|
-
return
|
13807
|
+
var ctor = (isArray(Type) ? Type[Type.length - 1] : Type);
|
13808
|
+
var args = injectionArgs(Type, locals, serviceName);
|
13809
|
+
// Empty object at position 0 is ignored for invocation with `new`, but required.
|
13810
|
+
args.unshift(null);
|
13811
|
+
return new (Function.prototype.bind.apply(ctor, args))();
|
13738
13812
|
}
|
13739
13813
|
|
13814
|
+
|
13740
13815
|
return {
|
13741
13816
|
invoke: invoke,
|
13742
13817
|
instantiate: instantiate,
|
@@ -14351,8 +14426,8 @@ var $AnimateProvider = ['$provide', function($provide) {
|
|
14351
14426
|
* // remove all the animation event listeners listening for `enter` on the given element and its children
|
14352
14427
|
* $animate.off('enter', container);
|
14353
14428
|
*
|
14354
|
-
* // remove the event listener function provided by `
|
14355
|
-
* // to listen for `enter` on the given `
|
14429
|
+
* // remove the event listener function provided by `callback` that is set
|
14430
|
+
* // to listen for `enter` on the given `container` as well as its children
|
14356
14431
|
* $animate.off('enter', container, callback);
|
14357
14432
|
* ```
|
14358
14433
|
*
|
@@ -14575,7 +14650,7 @@ var $AnimateProvider = ['$provide', function($provide) {
|
|
14575
14650
|
*
|
14576
14651
|
* @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
|
14577
14652
|
* If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take
|
14578
|
-
* on the provided styles. For example, if a transition animation is set for the given
|
14653
|
+
* on the provided styles. For example, if a transition animation is set for the given classNamem, then the provided `from` and
|
14579
14654
|
* `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding
|
14580
14655
|
* style in `to`, the style in `from` is applied immediately, and no animation is run.
|
14581
14656
|
* If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`
|
@@ -14597,7 +14672,7 @@ var $AnimateProvider = ['$provide', function($provide) {
|
|
14597
14672
|
* @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.
|
14598
14673
|
* @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If
|
14599
14674
|
* this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.
|
14600
|
-
* (Note that if no animation is detected then this value will not be
|
14675
|
+
* (Note that if no animation is detected then this value will not be applied to the element.)
|
14601
14676
|
* @param {object=} options an optional collection of options/styles that will be applied to the element
|
14602
14677
|
*
|
14603
14678
|
* @return {Promise} the animation callback promise
|
@@ -14835,7 +14910,7 @@ var $CoreAnimateCssProvider = function() {
|
|
14835
14910
|
options.from = null;
|
14836
14911
|
}
|
14837
14912
|
|
14838
|
-
/* jshint newcap: false*/
|
14913
|
+
/* jshint newcap: false */
|
14839
14914
|
var closed, runner = new $$AnimateRunner();
|
14840
14915
|
return {
|
14841
14916
|
start: run,
|
@@ -15761,7 +15836,7 @@ function $TemplateCacheProvider() {
|
|
15761
15836
|
* When this property is set to true, the HTML compiler will collect DOM nodes between
|
15762
15837
|
* nodes with the attributes `directive-name-start` and `directive-name-end`, and group them
|
15763
15838
|
* together as the directive elements. It is recommended that this feature be used on directives
|
15764
|
-
* which are not strictly
|
15839
|
+
* which are not strictly behavioral (such as {@link ngClick}), and which
|
15765
15840
|
* do not manipulate or replace child nodes (such as {@link ngInclude}).
|
15766
15841
|
*
|
15767
15842
|
* #### `priority`
|
@@ -15799,35 +15874,62 @@ function $TemplateCacheProvider() {
|
|
15799
15874
|
* is bound to the parent scope, via matching attributes on the directive's element:
|
15800
15875
|
*
|
15801
15876
|
* * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is
|
15802
|
-
* always a string since DOM attributes are strings. If no `attr` name is specified
|
15803
|
-
* attribute name is assumed to be the same as the local name.
|
15804
|
-
*
|
15805
|
-
*
|
15806
|
-
*
|
15807
|
-
*
|
15808
|
-
*
|
15809
|
-
*
|
15810
|
-
*
|
15811
|
-
*
|
15812
|
-
* name
|
15813
|
-
*
|
15814
|
-
*
|
15877
|
+
* always a string since DOM attributes are strings. If no `attr` name is specified then the
|
15878
|
+
* attribute name is assumed to be the same as the local name. Given `<my-component
|
15879
|
+
* my-attr="hello {{name}}">` and the isolate scope definition `scope: { localName:'@myAttr' }`,
|
15880
|
+
* the directive's scope property `localName` will reflect the interpolated value of `hello
|
15881
|
+
* {{name}}`. As the `name` attribute changes so will the `localName` property on the directive's
|
15882
|
+
* scope. The `name` is read from the parent scope (not the directive's scope).
|
15883
|
+
*
|
15884
|
+
* * `=` or `=attr` - set up a bidirectional binding between a local scope property and an expression
|
15885
|
+
* passed via the attribute `attr`. The expression is evaluated in the context of the parent scope.
|
15886
|
+
* If no `attr` name is specified then the attribute name is assumed to be the same as the local
|
15887
|
+
* name. Given `<my-component my-attr="parentModel">` and the isolate scope definition `scope: {
|
15888
|
+
* localModel: '=myAttr' }`, the property `localModel` on the directive's scope will reflect the
|
15889
|
+
* value of `parentModel` on the parent scope. Changes to `parentModel` will be reflected in
|
15890
|
+
* `localModel` and vice versa. Optional attributes should be marked as such with a question mark:
|
15891
|
+
* `=?` or `=?attr`. If the binding expression is non-assignable, or if the attribute isn't
|
15892
|
+
* optional and doesn't exist, an exception ({@link error/$compile/nonassign `$compile:nonassign`})
|
15893
|
+
* will be thrown upon discovering changes to the local value, since it will be impossible to sync
|
15894
|
+
* them back to the parent scope. By default, the {@link ng.$rootScope.Scope#$watch `$watch`}
|
15895
|
+
* method is used for tracking changes, and the equality check is based on object identity.
|
15896
|
+
* However, if an object literal or an array literal is passed as the binding expression, the
|
15897
|
+
* equality check is done by value (using the {@link angular.equals} function). It's also possible
|
15898
|
+
* to watch the evaluated value shallowly with {@link ng.$rootScope.Scope#$watchCollection
|
15899
|
+
* `$watchCollection`}: use `=*` or `=*attr` (`=*?` or `=*?attr` if the attribute is optional).
|
15900
|
+
*
|
15901
|
+
* * `<` or `<attr` - set up a one-way (one-directional) binding between a local scope property and an
|
15902
|
+
* expression passed via the attribute `attr`. The expression is evaluated in the context of the
|
15903
|
+
* parent scope. If no `attr` name is specified then the attribute name is assumed to be the same as the
|
15904
|
+
* local name. You can also make the binding optional by adding `?`: `<?` or `<?attr`.
|
15905
|
+
*
|
15906
|
+
* For example, given `<my-component my-attr="parentModel">` and directive definition of
|
15907
|
+
* `scope: { localModel:'<myAttr' }`, then the isolated scope property `localModel` will reflect the
|
15815
15908
|
* value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected
|
15816
|
-
* in `localModel
|
15817
|
-
*
|
15818
|
-
*
|
15819
|
-
*
|
15820
|
-
*
|
15821
|
-
*
|
15822
|
-
*
|
15823
|
-
*
|
15824
|
-
*
|
15825
|
-
*
|
15826
|
-
*
|
15827
|
-
*
|
15828
|
-
*
|
15829
|
-
*
|
15830
|
-
*
|
15909
|
+
* in `localModel`, but changes in `localModel` will not reflect in `parentModel`. There are however
|
15910
|
+
* two caveats:
|
15911
|
+
* 1. one-way binding does not copy the value from the parent to the isolate scope, it simply
|
15912
|
+
* sets the same value. That means if your bound value is an object, changes to its properties
|
15913
|
+
* in the isolated scope will be reflected in the parent scope (because both reference the same object).
|
15914
|
+
* 2. one-way binding watches changes to the **identity** of the parent value. That means the
|
15915
|
+
* {@link ng.$rootScope.Scope#$watch `$watch`} on the parent value only fires if the reference
|
15916
|
+
* to the value has changed. In most cases, this should not be of concern, but can be important
|
15917
|
+
* to know if you one-way bind to an object, and then replace that object in the isolated scope.
|
15918
|
+
* If you now change a property of the object in your parent scope, the change will not be
|
15919
|
+
* propagated to the isolated scope, because the identity of the object on the parent scope
|
15920
|
+
* has not changed. Instead you must assign a new object.
|
15921
|
+
*
|
15922
|
+
* One-way binding is useful if you do not plan to propagate changes to your isolated scope bindings
|
15923
|
+
* back to the parent. However, it does not make this completely impossible.
|
15924
|
+
*
|
15925
|
+
* * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. If
|
15926
|
+
* no `attr` name is specified then the attribute name is assumed to be the same as the local name.
|
15927
|
+
* Given `<my-component my-attr="count = count + value">` and the isolate scope definition `scope: {
|
15928
|
+
* localFn:'&myAttr' }`, the isolate scope property `localFn` will point to a function wrapper for
|
15929
|
+
* the `count = count + value` expression. Often it's desirable to pass data from the isolated scope
|
15930
|
+
* via an expression to the parent scope. This can be done by passing a map of local variable names
|
15931
|
+
* and values into the expression wrapper fn. For example, if the expression is `increment(amount)`
|
15932
|
+
* then we can specify the amount value by calling the `localFn` as `localFn({amount: 22})`.
|
15831
15933
|
*
|
15832
15934
|
* In general it's possible to apply more than one directive to one element, but there might be limitations
|
15833
15935
|
* depending on the type of scope required by the directives. The following points will help explain these limitations.
|
@@ -15851,8 +15953,18 @@ function $TemplateCacheProvider() {
|
|
15851
15953
|
* definition: `controller: 'myCtrl as myAlias'`.
|
15852
15954
|
*
|
15853
15955
|
* When an isolate scope is used for a directive (see above), `bindToController: true` will
|
15854
|
-
* allow a component to have its properties bound to the controller, rather than to scope.
|
15855
|
-
*
|
15956
|
+
* allow a component to have its properties bound to the controller, rather than to scope.
|
15957
|
+
*
|
15958
|
+
* After the controller is instantiated, the initial values of the isolate scope bindings will be bound to the controller
|
15959
|
+
* properties. You can access these bindings once they have been initialized by providing a controller method called
|
15960
|
+
* `$onInit`, which is called after all the controllers on an element have been constructed and had their bindings
|
15961
|
+
* initialized.
|
15962
|
+
*
|
15963
|
+
* <div class="alert alert-warning">
|
15964
|
+
* **Deprecation warning:** although bindings for non-ES6 class controllers are currently
|
15965
|
+
* bound to `this` before the controller constructor is called, this use is now deprecated. Please place initialization
|
15966
|
+
* code that relies upon bindings inside a `$onInit` method on the controller, instead.
|
15967
|
+
* </div>
|
15856
15968
|
*
|
15857
15969
|
* It is also possible to set `bindToController` to an object hash with the same format as the `scope` property.
|
15858
15970
|
* This will set up the scope bindings to the controller directly. Note that `scope` can still be used
|
@@ -15872,10 +15984,10 @@ function $TemplateCacheProvider() {
|
|
15872
15984
|
* * `$element` - Current element
|
15873
15985
|
* * `$attrs` - Current attributes object for the element
|
15874
15986
|
* * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:
|
15875
|
-
* `function([scope], cloneLinkingFn, futureParentElement)
|
15876
|
-
* * `scope`: optional
|
15877
|
-
* * `cloneLinkingFn`: optional argument to create clones of the original transcluded content.
|
15878
|
-
* * `futureParentElement
|
15987
|
+
* `function([scope], cloneLinkingFn, futureParentElement, slotName)`:
|
15988
|
+
* * `scope`: (optional) override the scope.
|
15989
|
+
* * `cloneLinkingFn`: (optional) argument to create clones of the original transcluded content.
|
15990
|
+
* * `futureParentElement` (optional):
|
15879
15991
|
* * defines the parent to which the `cloneLinkingFn` will add the cloned elements.
|
15880
15992
|
* * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.
|
15881
15993
|
* * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)
|
@@ -15883,14 +15995,34 @@ function $TemplateCacheProvider() {
|
|
15883
15995
|
* as those elements need to created and cloned in a special way when they are defined outside their
|
15884
15996
|
* usual containers (e.g. like `<svg>`).
|
15885
15997
|
* * See also the `directive.templateNamespace` property.
|
15998
|
+
* * `slotName`: (optional) the name of the slot to transclude. If falsy (e.g. `null`, `undefined` or `''`)
|
15999
|
+
* then the default translusion is provided.
|
16000
|
+
* The `$transclude` function also has a method on it, `$transclude.isSlotFilled(slotName)`, which returns
|
16001
|
+
* `true` if the specified slot contains content (i.e. one or more DOM nodes).
|
15886
16002
|
*
|
16003
|
+
* The controller can provide the following methods that act as life-cycle hooks:
|
16004
|
+
* * `$onInit` - Called on each controller after all the controllers on an element have been constructed and
|
16005
|
+
* had their bindings initialized (and before the pre & post linking functions for the directives on
|
16006
|
+
* this element). This is a good place to put initialization code for your controller.
|
15887
16007
|
*
|
15888
16008
|
* #### `require`
|
15889
16009
|
* Require another directive and inject its controller as the fourth argument to the linking function. The
|
15890
|
-
* `require`
|
15891
|
-
*
|
15892
|
-
*
|
15893
|
-
*
|
16010
|
+
* `require` property can be a string, an array or an object:
|
16011
|
+
* * a **string** containing the name of the directive to pass to the linking function
|
16012
|
+
* * an **array** containing the names of directives to pass to the linking function. The argument passed to the
|
16013
|
+
* linking function will be an array of controllers in the same order as the names in the `require` property
|
16014
|
+
* * an **object** whose property values are the names of the directives to pass to the linking function. The argument
|
16015
|
+
* passed to the linking function will also be an object with matching keys, whose values will hold the corresponding
|
16016
|
+
* controllers.
|
16017
|
+
*
|
16018
|
+
* If the `require` property is an object and `bindToController` is truthy, then the required controllers are
|
16019
|
+
* bound to the controller using the keys of the `require` property. This binding occurs after all the controllers
|
16020
|
+
* have been constructed but before `$onInit` is called.
|
16021
|
+
* See the {@link $compileProvider#component} helper for an example of how this can be used.
|
16022
|
+
*
|
16023
|
+
* If no such required directive(s) can be found, or if the directive does not have a controller, then an error is
|
16024
|
+
* raised (unless no link function is specified and the required controllers are not being bound to the directive
|
16025
|
+
* controller, in which case error checking is skipped). The name can be prefixed with:
|
15894
16026
|
*
|
15895
16027
|
* * (no prefix) - Locate the required controller on the current element. Throw an error if not found.
|
15896
16028
|
* * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.
|
@@ -15983,14 +16115,6 @@ function $TemplateCacheProvider() {
|
|
15983
16115
|
* The contents are compiled and provided to the directive as a **transclusion function**. See the
|
15984
16116
|
* {@link $compile#transclusion Transclusion} section below.
|
15985
16117
|
*
|
15986
|
-
* There are two kinds of transclusion depending upon whether you want to transclude just the contents of the
|
15987
|
-
* directive's element or the entire element:
|
15988
|
-
*
|
15989
|
-
* * `true` - transclude the content (i.e. the child nodes) of the directive's element.
|
15990
|
-
* * `'element'` - transclude the whole of the directive's element including any directives on this
|
15991
|
-
* element that defined at a lower priority than this directive. When used, the `template`
|
15992
|
-
* property is ignored.
|
15993
|
-
*
|
15994
16118
|
*
|
15995
16119
|
* #### `compile`
|
15996
16120
|
*
|
@@ -16018,7 +16142,7 @@ function $TemplateCacheProvider() {
|
|
16018
16142
|
|
16019
16143
|
* <div class="alert alert-warning">
|
16020
16144
|
* **Note:** The compile function cannot handle directives that recursively use themselves in their
|
16021
|
-
* own templates or compile functions. Compiling these directives results in an infinite loop and
|
16145
|
+
* own templates or compile functions. Compiling these directives results in an infinite loop and
|
16022
16146
|
* stack overflow errors.
|
16023
16147
|
*
|
16024
16148
|
* This can be avoided by manually using $compile in the postLink function to imperatively compile
|
@@ -16120,6 +16244,34 @@ function $TemplateCacheProvider() {
|
|
16120
16244
|
* Testing Transclusion Directives}.
|
16121
16245
|
* </div>
|
16122
16246
|
*
|
16247
|
+
* There are three kinds of transclusion depending upon whether you want to transclude just the contents of the
|
16248
|
+
* directive's element, the entire element or multiple parts of the element contents:
|
16249
|
+
*
|
16250
|
+
* * `true` - transclude the content (i.e. the child nodes) of the directive's element.
|
16251
|
+
* * `'element'` - transclude the whole of the directive's element including any directives on this
|
16252
|
+
* element that defined at a lower priority than this directive. When used, the `template`
|
16253
|
+
* property is ignored.
|
16254
|
+
* * **`{...}` (an object hash):** - map elements of the content onto transclusion "slots" in the template.
|
16255
|
+
*
|
16256
|
+
* **Mult-slot transclusion** is declared by providing an object for the `transclude` property.
|
16257
|
+
*
|
16258
|
+
* This object is a map where the keys are the name of the slot to fill and the value is an element selector
|
16259
|
+
* used to match the HTML to the slot. The element selector should be in normalized form (e.g. `myElement`)
|
16260
|
+
* and will match the standard element variants (e.g. `my-element`, `my:element`, `data-my-element`, etc).
|
16261
|
+
*
|
16262
|
+
* For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}
|
16263
|
+
*
|
16264
|
+
* If the element selector is prefixed with a `?` then that slot is optional.
|
16265
|
+
*
|
16266
|
+
* For example, the transclude object `{ slotA: '?myCustomElement' }` maps `<my-custom-element>` elements to
|
16267
|
+
* the `slotA` slot, which can be accessed via the `$transclude` function or via the {@link ngTransclude} directive.
|
16268
|
+
*
|
16269
|
+
* Slots that are not marked as optional (`?`) will trigger a compile time error if there are no matching elements
|
16270
|
+
* in the transclude content. If you wish to know if an optional slot was filled with content, then you can call
|
16271
|
+
* `$transclude.isSlotFilled(slotName)` on the transclude function passed to the directive's link function and
|
16272
|
+
* injectable into the directive's controller.
|
16273
|
+
*
|
16274
|
+
*
|
16123
16275
|
* #### Transclusion Functions
|
16124
16276
|
*
|
16125
16277
|
* When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion
|
@@ -16140,7 +16292,7 @@ function $TemplateCacheProvider() {
|
|
16140
16292
|
* content and the `scope` is the newly created transclusion scope, to which the clone is bound.
|
16141
16293
|
*
|
16142
16294
|
* <div class="alert alert-info">
|
16143
|
-
* **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a
|
16295
|
+
* **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a transclude function
|
16144
16296
|
* since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.
|
16145
16297
|
* </div>
|
16146
16298
|
*
|
@@ -16172,7 +16324,7 @@ function $TemplateCacheProvider() {
|
|
16172
16324
|
* </div>
|
16173
16325
|
*
|
16174
16326
|
* The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}
|
16175
|
-
* automatically destroy their
|
16327
|
+
* automatically destroy their transcluded clones as necessary so you do not need to worry about this if
|
16176
16328
|
* you are simply using {@link ngTransclude} to inject the transclusion into your directive.
|
16177
16329
|
*
|
16178
16330
|
*
|
@@ -16217,10 +16369,9 @@ function $TemplateCacheProvider() {
|
|
16217
16369
|
* The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the
|
16218
16370
|
* `link()` or `compile()` functions. It has a variety of uses.
|
16219
16371
|
*
|
16220
|
-
*
|
16221
|
-
*
|
16222
|
-
* the attributes
|
16223
|
-
* the attributes.
|
16372
|
+
* * *Accessing normalized attribute names:* Directives like 'ngBind' can be expressed in many ways:
|
16373
|
+
* 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. The attributes object allows for normalized access
|
16374
|
+
* to the attributes.
|
16224
16375
|
*
|
16225
16376
|
* * *Directive inter-communication:* All directives share the same instance of the attributes
|
16226
16377
|
* object which allows the directives to use the attributes object as inter directive
|
@@ -16410,7 +16561,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16410
16561
|
var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
|
16411
16562
|
|
16412
16563
|
function parseIsolateBindings(scope, directiveName, isController) {
|
16413
|
-
var LOCAL_REGEXP = /^\s*([
|
16564
|
+
var LOCAL_REGEXP = /^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/;
|
16414
16565
|
|
16415
16566
|
var bindings = {};
|
16416
16567
|
|
@@ -16497,8 +16648,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16497
16648
|
* @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which
|
16498
16649
|
* will match as <code>ng-bind</code>), or an object map of directives where the keys are the
|
16499
16650
|
* names and the values are the factories.
|
16500
|
-
* @param {Function|Array} directiveFactory An injectable directive factory function. See
|
16501
|
-
* {@link guide/directive} for more info.
|
16651
|
+
* @param {Function|Array} directiveFactory An injectable directive factory function. See the
|
16652
|
+
* {@link guide/directive directive guide} and the {@link $compile compile API} for more info.
|
16502
16653
|
* @returns {ng.$compileProvider} Self for chaining.
|
16503
16654
|
*/
|
16504
16655
|
this.directive = function registerDirective(name, directiveFactory) {
|
@@ -16545,6 +16696,128 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16545
16696
|
return this;
|
16546
16697
|
};
|
16547
16698
|
|
16699
|
+
/**
|
16700
|
+
* @ngdoc method
|
16701
|
+
* @name $compileProvider#component
|
16702
|
+
* @module ng
|
16703
|
+
* @param {string} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`)
|
16704
|
+
* @param {Object} options Component definition object (a simplified
|
16705
|
+
* {@link ng.$compile#directive-definition-object directive definition object}),
|
16706
|
+
* with the following properties (all optional):
|
16707
|
+
*
|
16708
|
+
* - `controller` – `{(string|function()=}` – controller constructor function that should be
|
16709
|
+
* associated with newly created scope or the name of a {@link ng.$compile#-controller-
|
16710
|
+
* registered controller} if passed as a string. An empty `noop` function by default.
|
16711
|
+
* - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.
|
16712
|
+
* If present, the controller will be published to scope under the `controllerAs` name.
|
16713
|
+
* If not present, this will default to be `$ctrl`.
|
16714
|
+
* - `template` – `{string=|function()=}` – html template as a string or a function that
|
16715
|
+
* returns an html template as a string which should be used as the contents of this component.
|
16716
|
+
* Empty string by default.
|
16717
|
+
*
|
16718
|
+
* If `template` is a function, then it is {@link auto.$injector#invoke injected} with
|
16719
|
+
* the following locals:
|
16720
|
+
*
|
16721
|
+
* - `$element` - Current element
|
16722
|
+
* - `$attrs` - Current attributes object for the element
|
16723
|
+
*
|
16724
|
+
* - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
|
16725
|
+
* template that should be used as the contents of this component.
|
16726
|
+
*
|
16727
|
+
* If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with
|
16728
|
+
* the following locals:
|
16729
|
+
*
|
16730
|
+
* - `$element` - Current element
|
16731
|
+
* - `$attrs` - Current attributes object for the element
|
16732
|
+
*
|
16733
|
+
* - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties.
|
16734
|
+
* Component properties are always bound to the component controller and not to the scope.
|
16735
|
+
* See {@link ng.$compile#-bindtocontroller- `bindToController`}.
|
16736
|
+
* - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled.
|
16737
|
+
* Disabled by default.
|
16738
|
+
* - `$...` – `{function()=}` – additional annotations to provide to the directive factory function.
|
16739
|
+
*
|
16740
|
+
* @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls.
|
16741
|
+
* @description
|
16742
|
+
* Register a **component definition** with the compiler. This is a shorthand for registering a special
|
16743
|
+
* type of directive, which represents a self-contained UI component in your application. Such components
|
16744
|
+
* are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`).
|
16745
|
+
*
|
16746
|
+
* Component definitions are very simple and do not require as much configuration as defining general
|
16747
|
+
* directives. Component definitions usually consist only of a template and a controller backing it.
|
16748
|
+
*
|
16749
|
+
* In order to make the definition easier, components enforce best practices like use of `controllerAs`,
|
16750
|
+
* `bindToController`. They always have **isolate scope** and are restricted to elements.
|
16751
|
+
*
|
16752
|
+
* Here are a few examples of how you would usually define components:
|
16753
|
+
*
|
16754
|
+
* ```js
|
16755
|
+
* var myMod = angular.module(...);
|
16756
|
+
* myMod.component('myComp', {
|
16757
|
+
* template: '<div>My name is {{$ctrl.name}}</div>',
|
16758
|
+
* controller: function() {
|
16759
|
+
* this.name = 'shahar';
|
16760
|
+
* }
|
16761
|
+
* });
|
16762
|
+
*
|
16763
|
+
* myMod.component('myComp', {
|
16764
|
+
* template: '<div>My name is {{$ctrl.name}}</div>',
|
16765
|
+
* bindings: {name: '@'}
|
16766
|
+
* });
|
16767
|
+
*
|
16768
|
+
* myMod.component('myComp', {
|
16769
|
+
* templateUrl: 'views/my-comp.html',
|
16770
|
+
* controller: 'MyCtrl as ctrl',
|
16771
|
+
* bindings: {name: '@'}
|
16772
|
+
* });
|
16773
|
+
*
|
16774
|
+
* ```
|
16775
|
+
* For more examples, and an in-depth guide, see the {@link guide/component component guide}.
|
16776
|
+
*
|
16777
|
+
* <br />
|
16778
|
+
* See also {@link ng.$compileProvider#directive $compileProvider.directive()}.
|
16779
|
+
*/
|
16780
|
+
this.component = function registerComponent(name, options) {
|
16781
|
+
var controller = options.controller || function() {};
|
16782
|
+
|
16783
|
+
function factory($injector) {
|
16784
|
+
function makeInjectable(fn) {
|
16785
|
+
if (isFunction(fn) || isArray(fn)) {
|
16786
|
+
return function(tElement, tAttrs) {
|
16787
|
+
return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs});
|
16788
|
+
};
|
16789
|
+
} else {
|
16790
|
+
return fn;
|
16791
|
+
}
|
16792
|
+
}
|
16793
|
+
|
16794
|
+
var template = (!options.template && !options.templateUrl ? '' : options.template);
|
16795
|
+
return {
|
16796
|
+
controller: controller,
|
16797
|
+
controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl',
|
16798
|
+
template: makeInjectable(template),
|
16799
|
+
templateUrl: makeInjectable(options.templateUrl),
|
16800
|
+
transclude: options.transclude,
|
16801
|
+
scope: {},
|
16802
|
+
bindToController: options.bindings || {},
|
16803
|
+
restrict: 'E',
|
16804
|
+
require: options.require
|
16805
|
+
};
|
16806
|
+
}
|
16807
|
+
|
16808
|
+
// Copy any annotation properties (starting with $) over to the factory function
|
16809
|
+
// These could be used by libraries such as the new component router
|
16810
|
+
forEach(options, function(val, key) {
|
16811
|
+
if (key.charAt(0) === '$') {
|
16812
|
+
factory[key] = val;
|
16813
|
+
}
|
16814
|
+
});
|
16815
|
+
|
16816
|
+
factory.$inject = ['$injector'];
|
16817
|
+
|
16818
|
+
return this.directive(name, factory);
|
16819
|
+
};
|
16820
|
+
|
16548
16821
|
|
16549
16822
|
/**
|
16550
16823
|
* @ngdoc method
|
@@ -16642,6 +16915,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16642
16915
|
function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse,
|
16643
16916
|
$controller, $rootScope, $sce, $animate, $$sanitizeUri) {
|
16644
16917
|
|
16918
|
+
var SIMPLE_ATTR_NAME = /^\w/;
|
16919
|
+
var specialAttrHolder = document.createElement('div');
|
16645
16920
|
var Attributes = function(element, attributesToCopy) {
|
16646
16921
|
if (attributesToCopy) {
|
16647
16922
|
var keys = Object.keys(attributesToCopy);
|
@@ -16777,7 +17052,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16777
17052
|
|
16778
17053
|
nodeName = nodeName_(this.$$element);
|
16779
17054
|
|
16780
|
-
if ((nodeName === 'a' && key === 'href') ||
|
17055
|
+
if ((nodeName === 'a' && (key === 'href' || key === 'xlinkHref')) ||
|
16781
17056
|
(nodeName === 'img' && key === 'src')) {
|
16782
17057
|
// sanitize a[href] and img[src] values
|
16783
17058
|
this[key] = value = $$sanitizeUri(value, key === 'src');
|
@@ -16821,7 +17096,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16821
17096
|
if (value === null || isUndefined(value)) {
|
16822
17097
|
this.$$element.removeAttr(attrName);
|
16823
17098
|
} else {
|
16824
|
-
|
17099
|
+
if (SIMPLE_ATTR_NAME.test(attrName)) {
|
17100
|
+
this.$$element.attr(attrName, value);
|
17101
|
+
} else {
|
17102
|
+
setSpecialAttr(this.$$element[0], attrName, value);
|
17103
|
+
}
|
16825
17104
|
}
|
16826
17105
|
}
|
16827
17106
|
|
@@ -16875,6 +17154,18 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16875
17154
|
}
|
16876
17155
|
};
|
16877
17156
|
|
17157
|
+
function setSpecialAttr(element, attrName, value) {
|
17158
|
+
// Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute`
|
17159
|
+
// so we have to jump through some hoops to get such an attribute
|
17160
|
+
// https://github.com/angular/angular.js/pull/13318
|
17161
|
+
specialAttrHolder.innerHTML = "<span " + attrName + ">";
|
17162
|
+
var attributes = specialAttrHolder.firstChild.attributes;
|
17163
|
+
var attribute = attributes[0];
|
17164
|
+
// We have to remove the attribute from its container element before we can add it to the destination element
|
17165
|
+
attributes.removeNamedItem(attribute.name);
|
17166
|
+
attribute.value = value;
|
17167
|
+
element.attributes.setNamedItem(attribute);
|
17168
|
+
}
|
16878
17169
|
|
16879
17170
|
function safeAddClass($element, className) {
|
16880
17171
|
try {
|
@@ -16888,7 +17179,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16888
17179
|
|
16889
17180
|
var startSymbol = $interpolate.startSymbol(),
|
16890
17181
|
endSymbol = $interpolate.endSymbol(),
|
16891
|
-
denormalizeTemplate = (startSymbol == '{{'
|
17182
|
+
denormalizeTemplate = (startSymbol == '{{' && endSymbol == '}}')
|
16892
17183
|
? identity
|
16893
17184
|
: function denormalizeTemplate(template) {
|
16894
17185
|
return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
|
@@ -16932,13 +17223,19 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16932
17223
|
// modify it.
|
16933
17224
|
$compileNodes = jqLite($compileNodes);
|
16934
17225
|
}
|
17226
|
+
|
17227
|
+
var NOT_EMPTY = /\S+/;
|
17228
|
+
|
16935
17229
|
// We can not compile top level text elements since text nodes can be merged and we will
|
16936
17230
|
// not be able to attach scope data to them, so we will wrap them in <span>
|
16937
|
-
|
16938
|
-
|
16939
|
-
|
17231
|
+
for (var i = 0, len = $compileNodes.length; i < len; i++) {
|
17232
|
+
var domNode = $compileNodes[i];
|
17233
|
+
|
17234
|
+
if (domNode.nodeType === NODE_TYPE_TEXT && domNode.nodeValue.match(NOT_EMPTY) /* non-empty */) {
|
17235
|
+
jqLiteWrapNode(domNode, $compileNodes[i] = document.createElement('span'));
|
16940
17236
|
}
|
16941
|
-
}
|
17237
|
+
}
|
17238
|
+
|
16942
17239
|
var compositeLinkFn =
|
16943
17240
|
compileNodes($compileNodes, transcludeFn, $compileNodes,
|
16944
17241
|
maxPriority, ignoreDirective, previousCompileContext);
|
@@ -17009,7 +17306,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17009
17306
|
if (!node) {
|
17010
17307
|
return 'html';
|
17011
17308
|
} else {
|
17012
|
-
return nodeName_(node) !== 'foreignobject' &&
|
17309
|
+
return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html';
|
17013
17310
|
}
|
17014
17311
|
}
|
17015
17312
|
|
@@ -17143,6 +17440,17 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17143
17440
|
});
|
17144
17441
|
};
|
17145
17442
|
|
17443
|
+
// We need to attach the transclusion slots onto the `boundTranscludeFn`
|
17444
|
+
// so that they are available inside the `controllersBoundTransclude` function
|
17445
|
+
var boundSlots = boundTranscludeFn.$$slots = createMap();
|
17446
|
+
for (var slotName in transcludeFn.$$slots) {
|
17447
|
+
if (transcludeFn.$$slots[slotName]) {
|
17448
|
+
boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn);
|
17449
|
+
} else {
|
17450
|
+
boundSlots[slotName] = null;
|
17451
|
+
}
|
17452
|
+
}
|
17453
|
+
|
17146
17454
|
return boundTranscludeFn;
|
17147
17455
|
}
|
17148
17456
|
|
@@ -17301,6 +17609,37 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17301
17609
|
};
|
17302
17610
|
}
|
17303
17611
|
|
17612
|
+
/**
|
17613
|
+
* A function generator that is used to support both eager and lazy compilation
|
17614
|
+
* linking function.
|
17615
|
+
* @param eager
|
17616
|
+
* @param $compileNodes
|
17617
|
+
* @param transcludeFn
|
17618
|
+
* @param maxPriority
|
17619
|
+
* @param ignoreDirective
|
17620
|
+
* @param previousCompileContext
|
17621
|
+
* @returns {Function}
|
17622
|
+
*/
|
17623
|
+
function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {
|
17624
|
+
if (eager) {
|
17625
|
+
return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
|
17626
|
+
}
|
17627
|
+
|
17628
|
+
var compiled;
|
17629
|
+
|
17630
|
+
return function() {
|
17631
|
+
if (!compiled) {
|
17632
|
+
compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
|
17633
|
+
|
17634
|
+
// Null out all of these references in order to make them eligible for garbage collection
|
17635
|
+
// since this is a potentially long lived closure
|
17636
|
+
$compileNodes = transcludeFn = previousCompileContext = null;
|
17637
|
+
}
|
17638
|
+
|
17639
|
+
return compiled.apply(this, arguments);
|
17640
|
+
};
|
17641
|
+
}
|
17642
|
+
|
17304
17643
|
/**
|
17305
17644
|
* Once the directives have been collected, their compile functions are executed. This method
|
17306
17645
|
* is responsible for inlining directive templates as well as terminating the application
|
@@ -17345,6 +17684,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17345
17684
|
replaceDirective = originalReplaceDirective,
|
17346
17685
|
childTranscludeFn = transcludeFn,
|
17347
17686
|
linkFn,
|
17687
|
+
didScanForMultipleTransclusion = false,
|
17688
|
+
mightHaveMultipleTransclusionError = false,
|
17348
17689
|
directiveValue;
|
17349
17690
|
|
17350
17691
|
// executes all directives on the current element
|
@@ -17387,6 +17728,27 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17387
17728
|
|
17388
17729
|
directiveName = directive.name;
|
17389
17730
|
|
17731
|
+
// If we encounter a condition that can result in transclusion on the directive,
|
17732
|
+
// then scan ahead in the remaining directives for others that may cause a multiple
|
17733
|
+
// transclusion error to be thrown during the compilation process. If a matching directive
|
17734
|
+
// is found, then we know that when we encounter a transcluded directive, we need to eagerly
|
17735
|
+
// compile the `transclude` function rather than doing it lazily in order to throw
|
17736
|
+
// exceptions at the correct time
|
17737
|
+
if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template))
|
17738
|
+
|| (directive.transclude && !directive.$$tlb))) {
|
17739
|
+
var candidateDirective;
|
17740
|
+
|
17741
|
+
for (var scanningIndex = i + 1; candidateDirective = directives[scanningIndex++];) {
|
17742
|
+
if ((candidateDirective.transclude && !candidateDirective.$$tlb)
|
17743
|
+
|| (candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template))) {
|
17744
|
+
mightHaveMultipleTransclusionError = true;
|
17745
|
+
break;
|
17746
|
+
}
|
17747
|
+
}
|
17748
|
+
|
17749
|
+
didScanForMultipleTransclusion = true;
|
17750
|
+
}
|
17751
|
+
|
17390
17752
|
if (!directive.templateUrl && directive.controller) {
|
17391
17753
|
directiveValue = directive.controller;
|
17392
17754
|
controllerDirectives = controllerDirectives || createMap();
|
@@ -17416,7 +17778,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17416
17778
|
compileNode = $compileNode[0];
|
17417
17779
|
replaceWith(jqCollection, sliceArgs($template), compileNode);
|
17418
17780
|
|
17419
|
-
childTranscludeFn =
|
17781
|
+
childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority,
|
17420
17782
|
replaceDirective && replaceDirective.name, {
|
17421
17783
|
// Don't pass in:
|
17422
17784
|
// - controllerDirectives - otherwise we'll create duplicates controllers
|
@@ -17428,10 +17790,69 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17428
17790
|
nonTlbTranscludeDirective: nonTlbTranscludeDirective
|
17429
17791
|
});
|
17430
17792
|
} else {
|
17793
|
+
|
17794
|
+
var slots = createMap();
|
17795
|
+
|
17431
17796
|
$template = jqLite(jqLiteClone(compileNode)).contents();
|
17797
|
+
|
17798
|
+
if (isObject(directiveValue)) {
|
17799
|
+
|
17800
|
+
// We have transclusion slots,
|
17801
|
+
// collect them up, compile them and store their transclusion functions
|
17802
|
+
$template = [];
|
17803
|
+
|
17804
|
+
var slotMap = createMap();
|
17805
|
+
var filledSlots = createMap();
|
17806
|
+
|
17807
|
+
// Parse the element selectors
|
17808
|
+
forEach(directiveValue, function(elementSelector, slotName) {
|
17809
|
+
// If an element selector starts with a ? then it is optional
|
17810
|
+
var optional = (elementSelector.charAt(0) === '?');
|
17811
|
+
elementSelector = optional ? elementSelector.substring(1) : elementSelector;
|
17812
|
+
|
17813
|
+
slotMap[elementSelector] = slotName;
|
17814
|
+
|
17815
|
+
// We explicitly assign `null` since this implies that a slot was defined but not filled.
|
17816
|
+
// Later when calling boundTransclusion functions with a slot name we only error if the
|
17817
|
+
// slot is `undefined`
|
17818
|
+
slots[slotName] = null;
|
17819
|
+
|
17820
|
+
// filledSlots contains `true` for all slots that are either optional or have been
|
17821
|
+
// filled. This is used to check that we have not missed any required slots
|
17822
|
+
filledSlots[slotName] = optional;
|
17823
|
+
});
|
17824
|
+
|
17825
|
+
// Add the matching elements into their slot
|
17826
|
+
forEach($compileNode.contents(), function(node) {
|
17827
|
+
var slotName = slotMap[directiveNormalize(nodeName_(node))];
|
17828
|
+
if (slotName) {
|
17829
|
+
filledSlots[slotName] = true;
|
17830
|
+
slots[slotName] = slots[slotName] || [];
|
17831
|
+
slots[slotName].push(node);
|
17832
|
+
} else {
|
17833
|
+
$template.push(node);
|
17834
|
+
}
|
17835
|
+
});
|
17836
|
+
|
17837
|
+
// Check for required slots that were not filled
|
17838
|
+
forEach(filledSlots, function(filled, slotName) {
|
17839
|
+
if (!filled) {
|
17840
|
+
throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName);
|
17841
|
+
}
|
17842
|
+
});
|
17843
|
+
|
17844
|
+
for (var slotName in slots) {
|
17845
|
+
if (slots[slotName]) {
|
17846
|
+
// Only define a transclusion function if the slot was filled
|
17847
|
+
slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slots[slotName], transcludeFn);
|
17848
|
+
}
|
17849
|
+
}
|
17850
|
+
}
|
17851
|
+
|
17432
17852
|
$compileNode.empty(); // clear contents
|
17433
|
-
childTranscludeFn =
|
17853
|
+
childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined,
|
17434
17854
|
undefined, { needsNewScope: directive.$$isolateScope || directive.$$newScope});
|
17855
|
+
childTranscludeFn.$$slots = slots;
|
17435
17856
|
}
|
17436
17857
|
}
|
17437
17858
|
|
@@ -17594,6 +18015,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17594
18015
|
for (var i = 0, ii = require.length; i < ii; i++) {
|
17595
18016
|
value[i] = getControllers(directiveName, require[i], $element, elementControllers);
|
17596
18017
|
}
|
18018
|
+
} else if (isObject(require)) {
|
18019
|
+
value = {};
|
18020
|
+
forEach(require, function(controller, property) {
|
18021
|
+
value[property] = getControllers(directiveName, controller, $element, elementControllers);
|
18022
|
+
});
|
17597
18023
|
}
|
17598
18024
|
|
17599
18025
|
return value || null;
|
@@ -17631,7 +18057,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17631
18057
|
}
|
17632
18058
|
|
17633
18059
|
function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
|
17634
|
-
var linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,
|
18060
|
+
var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,
|
17635
18061
|
attrs, removeScopeBindingWatches, removeControllerBindingWatches;
|
17636
18062
|
|
17637
18063
|
if (compileNode === linkNode) {
|
@@ -17654,6 +18080,10 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17654
18080
|
// is later passed as `parentBoundTranscludeFn` to `publicLinkFn`
|
17655
18081
|
transcludeFn = controllersBoundTransclude;
|
17656
18082
|
transcludeFn.$$boundTransclude = boundTranscludeFn;
|
18083
|
+
// expose the slots on the `$transclude` function
|
18084
|
+
transcludeFn.isSlotFilled = function(slotName) {
|
18085
|
+
return !!boundTranscludeFn.$$slots[slotName];
|
18086
|
+
};
|
17657
18087
|
}
|
17658
18088
|
|
17659
18089
|
if (controllerDirectives) {
|
@@ -17698,6 +18128,21 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17698
18128
|
}
|
17699
18129
|
}
|
17700
18130
|
|
18131
|
+
// Bind the required controllers to the controller, if `require` is an object and `bindToController` is truthy
|
18132
|
+
forEach(controllerDirectives, function(controllerDirective, name) {
|
18133
|
+
var require = controllerDirective.require;
|
18134
|
+
if (controllerDirective.bindToController && !isArray(require) && isObject(require)) {
|
18135
|
+
extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers));
|
18136
|
+
}
|
18137
|
+
});
|
18138
|
+
|
18139
|
+
// Trigger the `$onInit` method on all controllers that have one
|
18140
|
+
forEach(elementControllers, function(controller) {
|
18141
|
+
if (isFunction(controller.instance.$onInit)) {
|
18142
|
+
controller.instance.$onInit();
|
18143
|
+
}
|
18144
|
+
});
|
18145
|
+
|
17701
18146
|
// PRELINKING
|
17702
18147
|
for (i = 0, ii = preLinkFns.length; i < ii; i++) {
|
17703
18148
|
linkFn = preLinkFns[i];
|
@@ -17733,11 +18178,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17733
18178
|
|
17734
18179
|
// This is the function that is injected as `$transclude`.
|
17735
18180
|
// Note: all arguments are optional!
|
17736
|
-
function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {
|
18181
|
+
function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {
|
17737
18182
|
var transcludeControllers;
|
17738
|
-
|
17739
18183
|
// No scope passed in:
|
17740
18184
|
if (!isScope(scope)) {
|
18185
|
+
slotName = futureParentElement;
|
17741
18186
|
futureParentElement = cloneAttachFn;
|
17742
18187
|
cloneAttachFn = scope;
|
17743
18188
|
scope = undefined;
|
@@ -17749,7 +18194,23 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17749
18194
|
if (!futureParentElement) {
|
17750
18195
|
futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;
|
17751
18196
|
}
|
17752
|
-
|
18197
|
+
if (slotName) {
|
18198
|
+
// slotTranscludeFn can be one of three things:
|
18199
|
+
// * a transclude function - a filled slot
|
18200
|
+
// * `null` - an optional slot that was not filled
|
18201
|
+
// * `undefined` - a slot that was not declared (i.e. invalid)
|
18202
|
+
var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];
|
18203
|
+
if (slotTranscludeFn) {
|
18204
|
+
return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
|
18205
|
+
} else if (isUndefined(slotTranscludeFn)) {
|
18206
|
+
throw $compileMinErr('noslot',
|
18207
|
+
'No parent directive that requires a transclusion with slot name "{0}". ' +
|
18208
|
+
'Element: {1}',
|
18209
|
+
slotName, startingTag($element));
|
18210
|
+
}
|
18211
|
+
} else {
|
18212
|
+
return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
|
18213
|
+
}
|
17753
18214
|
}
|
17754
18215
|
}
|
17755
18216
|
}
|
@@ -18181,9 +18642,14 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
18181
18642
|
parent.replaceChild(newNode, firstElementToRemove);
|
18182
18643
|
}
|
18183
18644
|
|
18184
|
-
//
|
18645
|
+
// Append all the `elementsToRemove` to a fragment. This will...
|
18646
|
+
// - remove them from the DOM
|
18647
|
+
// - allow them to still be traversed with .nextSibling
|
18648
|
+
// - allow a single fragment.qSA to fetch all elements being removed
|
18185
18649
|
var fragment = document.createDocumentFragment();
|
18186
|
-
|
18650
|
+
for (i = 0; i < removeCount; i++) {
|
18651
|
+
fragment.appendChild(elementsToRemove[i]);
|
18652
|
+
}
|
18187
18653
|
|
18188
18654
|
if (jqLite.hasData(firstElementToRemove)) {
|
18189
18655
|
// Copy over user data (that includes Angular's $scope etc.). Don't copy private
|
@@ -18191,31 +18657,18 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
18191
18657
|
// event listeners (which is the main use of private data) wouldn't work anyway.
|
18192
18658
|
jqLite.data(newNode, jqLite.data(firstElementToRemove));
|
18193
18659
|
|
18194
|
-
// Remove
|
18195
|
-
|
18196
|
-
// for the new node. Instead, remove the data "manually".
|
18197
|
-
if (!jQuery) {
|
18198
|
-
delete jqLite.cache[firstElementToRemove[jqLite.expando]];
|
18199
|
-
} else {
|
18200
|
-
// jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after
|
18201
|
-
// the replaced element. The cleanData version monkey-patched by Angular would cause
|
18202
|
-
// the scope to be trashed and we do need the very same scope to work with the new
|
18203
|
-
// element. However, we cannot just cache the non-patched version and use it here as
|
18204
|
-
// that would break if another library patches the method after Angular does (one
|
18205
|
-
// example is jQuery UI). Instead, set a flag indicating scope destroying should be
|
18206
|
-
// skipped this one time.
|
18207
|
-
skipDestroyOnNextJQueryCleanData = true;
|
18208
|
-
jQuery.cleanData([firstElementToRemove]);
|
18209
|
-
}
|
18660
|
+
// Remove $destroy event listeners from `firstElementToRemove`
|
18661
|
+
jqLite(firstElementToRemove).off('$destroy');
|
18210
18662
|
}
|
18211
18663
|
|
18212
|
-
|
18213
|
-
|
18214
|
-
|
18215
|
-
fragment.appendChild(element);
|
18216
|
-
delete elementsToRemove[k];
|
18217
|
-
}
|
18664
|
+
// Cleanup any data/listeners on the elements and children.
|
18665
|
+
// This includes invoking the $destroy event on any elements with listeners.
|
18666
|
+
jqLite.cleanData(fragment.querySelectorAll('*'));
|
18218
18667
|
|
18668
|
+
// Update the jqLite collection to only contain the `newNode`
|
18669
|
+
for (i = 1; i < removeCount; i++) {
|
18670
|
+
delete elementsToRemove[i];
|
18671
|
+
}
|
18219
18672
|
elementsToRemove[0] = newNode;
|
18220
18673
|
elementsToRemove.length = 1;
|
18221
18674
|
}
|
@@ -18244,7 +18697,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
18244
18697
|
optional = definition.optional,
|
18245
18698
|
mode = definition.mode, // @, =, or &
|
18246
18699
|
lastValue,
|
18247
|
-
parentGet, parentSet, compare;
|
18700
|
+
parentGet, parentSet, compare, removeWatch;
|
18248
18701
|
|
18249
18702
|
switch (mode) {
|
18250
18703
|
|
@@ -18258,10 +18711,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
18258
18711
|
}
|
18259
18712
|
});
|
18260
18713
|
attrs.$$observers[attrName].$$scope = scope;
|
18261
|
-
|
18714
|
+
lastValue = attrs[attrName];
|
18715
|
+
if (isString(lastValue)) {
|
18262
18716
|
// If the attribute has been provided then we trigger an interpolation to ensure
|
18263
18717
|
// the value is there for use in the link fn
|
18264
|
-
destination[scopeName] = $interpolate(
|
18718
|
+
destination[scopeName] = $interpolate(lastValue)(scope);
|
18719
|
+
} else if (isBoolean(lastValue)) {
|
18720
|
+
// If the attributes is one of the BOOLEAN_ATTR then Angular will have converted
|
18721
|
+
// the value to boolean rather than a string, so we special case this situation
|
18722
|
+
destination[scopeName] = lastValue;
|
18265
18723
|
}
|
18266
18724
|
break;
|
18267
18725
|
|
@@ -18282,8 +18740,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
18282
18740
|
// reset the change, or we will throw this exception on every $digest
|
18283
18741
|
lastValue = destination[scopeName] = parentGet(scope);
|
18284
18742
|
throw $compileMinErr('nonassign',
|
18285
|
-
"Expression '{0}' used with directive '{
|
18286
|
-
attrs[attrName], directive.name);
|
18743
|
+
"Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!",
|
18744
|
+
attrs[attrName], attrName, directive.name);
|
18287
18745
|
};
|
18288
18746
|
lastValue = destination[scopeName] = parentGet(scope);
|
18289
18747
|
var parentValueWatch = function parentValueWatch(parentValue) {
|
@@ -18300,7 +18758,6 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
18300
18758
|
return lastValue = parentValue;
|
18301
18759
|
};
|
18302
18760
|
parentValueWatch.$stateful = true;
|
18303
|
-
var removeWatch;
|
18304
18761
|
if (definition.collection) {
|
18305
18762
|
removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);
|
18306
18763
|
} else {
|
@@ -18309,6 +18766,24 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
18309
18766
|
removeWatchCollection.push(removeWatch);
|
18310
18767
|
break;
|
18311
18768
|
|
18769
|
+
case '<':
|
18770
|
+
if (!hasOwnProperty.call(attrs, attrName)) {
|
18771
|
+
if (optional) break;
|
18772
|
+
attrs[attrName] = void 0;
|
18773
|
+
}
|
18774
|
+
if (optional && !attrs[attrName]) break;
|
18775
|
+
|
18776
|
+
parentGet = $parse(attrs[attrName]);
|
18777
|
+
|
18778
|
+
destination[scopeName] = parentGet(scope);
|
18779
|
+
|
18780
|
+
removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newParentValue) {
|
18781
|
+
destination[scopeName] = newParentValue;
|
18782
|
+
}, parentGet.literal);
|
18783
|
+
|
18784
|
+
removeWatchCollection.push(removeWatch);
|
18785
|
+
break;
|
18786
|
+
|
18312
18787
|
case '&':
|
18313
18788
|
// Don't assign Object.prototype method to scope
|
18314
18789
|
parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;
|
@@ -19228,7 +19703,7 @@ function $HttpProvider() {
|
|
19228
19703
|
*
|
19229
19704
|
* ```
|
19230
19705
|
* module.run(function($http) {
|
19231
|
-
* $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'
|
19706
|
+
* $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w';
|
19232
19707
|
* });
|
19233
19708
|
* ```
|
19234
19709
|
*
|
@@ -19456,13 +19931,13 @@ function $HttpProvider() {
|
|
19456
19931
|
*
|
19457
19932
|
* ### Cross Site Request Forgery (XSRF) Protection
|
19458
19933
|
*
|
19459
|
-
* [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is
|
19460
|
-
*
|
19461
|
-
* to counter XSRF. When performing XHR requests, the
|
19462
|
-
* (by default, `XSRF-TOKEN`) and sets it as an HTTP
|
19463
|
-
* JavaScript that runs on your domain could read the
|
19464
|
-
* the XHR came from JavaScript running on your domain.
|
19465
|
-
* cross-domain requests.
|
19934
|
+
* [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by
|
19935
|
+
* which the attacker can trick an authenticated user into unknowingly executing actions on your
|
19936
|
+
* website. Angular provides a mechanism to counter XSRF. When performing XHR requests, the
|
19937
|
+
* $http service reads a token from a cookie (by default, `XSRF-TOKEN`) and sets it as an HTTP
|
19938
|
+
* header (`X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read the
|
19939
|
+
* cookie, your server can be assured that the XHR came from JavaScript running on your domain.
|
19940
|
+
* The header will not be set for cross-domain requests.
|
19466
19941
|
*
|
19467
19942
|
* To take advantage of this, your server needs to set a token in a JavaScript readable session
|
19468
19943
|
* cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the
|
@@ -19621,7 +20096,7 @@ function $HttpProvider() {
|
|
19621
20096
|
*/
|
19622
20097
|
function $http(requestConfig) {
|
19623
20098
|
|
19624
|
-
if (!
|
20099
|
+
if (!isObject(requestConfig)) {
|
19625
20100
|
throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig);
|
19626
20101
|
}
|
19627
20102
|
|
@@ -19741,7 +20216,7 @@ function $HttpProvider() {
|
|
19741
20216
|
|
19742
20217
|
defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);
|
19743
20218
|
|
19744
|
-
// using for-in instead of forEach to avoid
|
20219
|
+
// using for-in instead of forEach to avoid unnecessary iteration after header has been found
|
19745
20220
|
defaultHeadersIteration:
|
19746
20221
|
for (defHeaderName in defHeaders) {
|
19747
20222
|
lowercaseDefHeaderName = lowercase(defHeaderName);
|
@@ -20240,6 +20715,14 @@ $interpolateMinErr.interr = function(text, err) {
|
|
20240
20715
|
*
|
20241
20716
|
* Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
|
20242
20717
|
*
|
20718
|
+
* <div class="alert alert-danger">
|
20719
|
+
* This feature is sometimes used to mix different markup languages, e.g. to wrap an Angular
|
20720
|
+
* template within a Python Jinja template (or any other template language). Mixing templating
|
20721
|
+
* languages is **very dangerous**. The embedding template language will not safely escape Angular
|
20722
|
+
* expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS)
|
20723
|
+
* security bugs!
|
20724
|
+
* </div>
|
20725
|
+
*
|
20243
20726
|
* @example
|
20244
20727
|
<example name="custom-interpolation-markup" module="customInterpolationApp">
|
20245
20728
|
<file name="index.html">
|
@@ -20340,6 +20823,15 @@ function $InterpolateProvider() {
|
|
20340
20823
|
return value;
|
20341
20824
|
}
|
20342
20825
|
|
20826
|
+
//TODO: this is the same as the constantWatchDelegate in parse.js
|
20827
|
+
function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {
|
20828
|
+
var unwatch;
|
20829
|
+
return unwatch = scope.$watch(function constantInterpolateWatch(scope) {
|
20830
|
+
unwatch();
|
20831
|
+
return constantInterp(scope);
|
20832
|
+
}, listener, objectEquality);
|
20833
|
+
}
|
20834
|
+
|
20343
20835
|
/**
|
20344
20836
|
* @ngdoc service
|
20345
20837
|
* @name $interpolate
|
@@ -20435,6 +20927,19 @@ function $InterpolateProvider() {
|
|
20435
20927
|
* - `context`: evaluation context for all expressions embedded in the interpolated text
|
20436
20928
|
*/
|
20437
20929
|
function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {
|
20930
|
+
// Provide a quick exit and simplified result function for text with no interpolation
|
20931
|
+
if (!text.length || text.indexOf(startSymbol) === -1) {
|
20932
|
+
var constantInterp;
|
20933
|
+
if (!mustHaveExpression) {
|
20934
|
+
var unescapedText = unescapeText(text);
|
20935
|
+
constantInterp = valueFn(unescapedText);
|
20936
|
+
constantInterp.exp = text;
|
20937
|
+
constantInterp.expressions = [];
|
20938
|
+
constantInterp.$$watchDelegate = constantWatchDelegate;
|
20939
|
+
}
|
20940
|
+
return constantInterp;
|
20941
|
+
}
|
20942
|
+
|
20438
20943
|
allOrNothing = !!allOrNothing;
|
20439
20944
|
var startIndex,
|
20440
20945
|
endIndex,
|
@@ -20571,8 +21076,8 @@ function $InterpolateProvider() {
|
|
20571
21076
|
}
|
20572
21077
|
|
20573
21078
|
function $IntervalProvider() {
|
20574
|
-
this.$get = ['$rootScope', '$window', '$q', '$$q',
|
20575
|
-
function($rootScope, $window, $q, $$q) {
|
21079
|
+
this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser',
|
21080
|
+
function($rootScope, $window, $q, $$q, $browser) {
|
20576
21081
|
var intervals = {};
|
20577
21082
|
|
20578
21083
|
|
@@ -20713,11 +21218,12 @@ function $IntervalProvider() {
|
|
20713
21218
|
|
20714
21219
|
count = isDefined(count) ? count : 0;
|
20715
21220
|
|
20716
|
-
promise.then(null, null, (!hasParams) ? fn : function() {
|
20717
|
-
fn.apply(null, args);
|
20718
|
-
});
|
20719
|
-
|
20720
21221
|
promise.$$intervalId = setInterval(function tick() {
|
21222
|
+
if (skipApply) {
|
21223
|
+
$browser.defer(callback);
|
21224
|
+
} else {
|
21225
|
+
$rootScope.$evalAsync(callback);
|
21226
|
+
}
|
20721
21227
|
deferred.notify(iteration++);
|
20722
21228
|
|
20723
21229
|
if (count > 0 && iteration >= count) {
|
@@ -20733,6 +21239,14 @@ function $IntervalProvider() {
|
|
20733
21239
|
intervals[promise.$$intervalId] = deferred;
|
20734
21240
|
|
20735
21241
|
return promise;
|
21242
|
+
|
21243
|
+
function callback() {
|
21244
|
+
if (!hasParams) {
|
21245
|
+
fn(iteration);
|
21246
|
+
} else {
|
21247
|
+
fn.apply(null, args);
|
21248
|
+
}
|
21249
|
+
}
|
20736
21250
|
}
|
20737
21251
|
|
20738
21252
|
|
@@ -21972,23 +22486,22 @@ function ensureSafeMemberName(name, fullExpression) {
|
|
21972
22486
|
return name;
|
21973
22487
|
}
|
21974
22488
|
|
21975
|
-
function getStringValue(name
|
21976
|
-
// From the JavaScript docs:
|
22489
|
+
function getStringValue(name) {
|
21977
22490
|
// Property names must be strings. This means that non-string objects cannot be used
|
21978
22491
|
// as keys in an object. Any non-string object, including a number, is typecasted
|
21979
22492
|
// into a string via the toString method.
|
22493
|
+
// -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names
|
21980
22494
|
//
|
21981
|
-
// So, to ensure that we are checking the same `name` that JavaScript would use,
|
21982
|
-
//
|
21983
|
-
//
|
21984
|
-
//
|
21985
|
-
|
21986
|
-
|
21987
|
-
|
21988
|
-
|
21989
|
-
|
21990
|
-
|
21991
|
-
return name;
|
22495
|
+
// So, to ensure that we are checking the same `name` that JavaScript would use, we cast it
|
22496
|
+
// to a string. It's not always possible. If `name` is an object and its `toString` method is
|
22497
|
+
// 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown:
|
22498
|
+
//
|
22499
|
+
// TypeError: Cannot convert object to primitive value
|
22500
|
+
//
|
22501
|
+
// For performance reasons, we don't catch this error here and allow it to propagate up the call
|
22502
|
+
// stack. Note that you'll get the same error in JavaScript if you try to access a property using
|
22503
|
+
// such a 'broken' object as a key.
|
22504
|
+
return name + '';
|
21992
22505
|
}
|
21993
22506
|
|
21994
22507
|
function ensureSafeObject(obj, fullExpression) {
|
@@ -22249,6 +22762,7 @@ AST.ArrayExpression = 'ArrayExpression';
|
|
22249
22762
|
AST.Property = 'Property';
|
22250
22763
|
AST.ObjectExpression = 'ObjectExpression';
|
22251
22764
|
AST.ThisExpression = 'ThisExpression';
|
22765
|
+
AST.LocalsExpression = 'LocalsExpression';
|
22252
22766
|
|
22253
22767
|
// Internal use only
|
22254
22768
|
AST.NGValueParameter = 'NGValueParameter';
|
@@ -22549,7 +23063,8 @@ AST.prototype = {
|
|
22549
23063
|
'false': { type: AST.Literal, value: false },
|
22550
23064
|
'null': { type: AST.Literal, value: null },
|
22551
23065
|
'undefined': {type: AST.Literal, value: undefined },
|
22552
|
-
'this': {type: AST.ThisExpression }
|
23066
|
+
'this': {type: AST.ThisExpression },
|
23067
|
+
'$locals': {type: AST.LocalsExpression }
|
22553
23068
|
}
|
22554
23069
|
};
|
22555
23070
|
|
@@ -22669,6 +23184,10 @@ function findConstantAndWatchExpressions(ast, $filter) {
|
|
22669
23184
|
ast.constant = false;
|
22670
23185
|
ast.toWatch = [];
|
22671
23186
|
break;
|
23187
|
+
case AST.LocalsExpression:
|
23188
|
+
ast.constant = false;
|
23189
|
+
ast.toWatch = [];
|
23190
|
+
break;
|
22672
23191
|
}
|
22673
23192
|
}
|
22674
23193
|
|
@@ -22912,6 +23431,9 @@ ASTCompiler.prototype = {
|
|
22912
23431
|
intoId = intoId || this.nextId();
|
22913
23432
|
self.recurse(ast.object, left, undefined, function() {
|
22914
23433
|
self.if_(self.notNull(left), function() {
|
23434
|
+
if (create && create !== 1) {
|
23435
|
+
self.addEnsureSafeAssignContext(left);
|
23436
|
+
}
|
22915
23437
|
if (ast.computed) {
|
22916
23438
|
right = self.nextId();
|
22917
23439
|
self.recurse(ast.property, right);
|
@@ -23035,6 +23557,10 @@ ASTCompiler.prototype = {
|
|
23035
23557
|
this.assign(intoId, 's');
|
23036
23558
|
recursionFn('s');
|
23037
23559
|
break;
|
23560
|
+
case AST.LocalsExpression:
|
23561
|
+
this.assign(intoId, 'l');
|
23562
|
+
recursionFn('l');
|
23563
|
+
break;
|
23038
23564
|
case AST.NGValueParameter:
|
23039
23565
|
this.assign(intoId, 'v');
|
23040
23566
|
recursionFn('v');
|
@@ -23142,7 +23668,7 @@ ASTCompiler.prototype = {
|
|
23142
23668
|
},
|
23143
23669
|
|
23144
23670
|
getStringValue: function(item) {
|
23145
|
-
this.assign(item, 'getStringValue(' + item + '
|
23671
|
+
this.assign(item, 'getStringValue(' + item + ')');
|
23146
23672
|
},
|
23147
23673
|
|
23148
23674
|
ensureSafeAssignContext: function(item) {
|
@@ -23362,6 +23888,10 @@ ASTInterpreter.prototype = {
|
|
23362
23888
|
return function(scope) {
|
23363
23889
|
return context ? {value: scope} : scope;
|
23364
23890
|
};
|
23891
|
+
case AST.LocalsExpression:
|
23892
|
+
return function(scope, locals) {
|
23893
|
+
return context ? {value: locals} : locals;
|
23894
|
+
};
|
23365
23895
|
case AST.NGValueParameter:
|
23366
23896
|
return function(scope, locals, assign, inputs) {
|
23367
23897
|
return context ? {value: assign} : assign;
|
@@ -23526,8 +24056,11 @@ ASTInterpreter.prototype = {
|
|
23526
24056
|
rhs = right(scope, locals, assign, inputs);
|
23527
24057
|
rhs = getStringValue(rhs);
|
23528
24058
|
ensureSafeMemberName(rhs, expression);
|
23529
|
-
if (create && create !== 1
|
23530
|
-
lhs
|
24059
|
+
if (create && create !== 1) {
|
24060
|
+
ensureSafeAssignContext(lhs);
|
24061
|
+
if (lhs && !(lhs[rhs])) {
|
24062
|
+
lhs[rhs] = {};
|
24063
|
+
}
|
23531
24064
|
}
|
23532
24065
|
value = lhs[rhs];
|
23533
24066
|
ensureSafeObject(value, expression);
|
@@ -23542,8 +24075,11 @@ ASTInterpreter.prototype = {
|
|
23542
24075
|
nonComputedMember: function(left, right, expensiveChecks, context, create, expression) {
|
23543
24076
|
return function(scope, locals, assign, inputs) {
|
23544
24077
|
var lhs = left(scope, locals, assign, inputs);
|
23545
|
-
if (create && create !== 1
|
23546
|
-
lhs
|
24078
|
+
if (create && create !== 1) {
|
24079
|
+
ensureSafeAssignContext(lhs);
|
24080
|
+
if (lhs && !(lhs[right])) {
|
24081
|
+
lhs[right] = {};
|
24082
|
+
}
|
23547
24083
|
}
|
23548
24084
|
var value = lhs != null ? lhs[right] : undefined;
|
23549
24085
|
if (expensiveChecks || isPossiblyDangerousMemberName(right)) {
|
@@ -23659,10 +24195,19 @@ function $ParseProvider() {
|
|
23659
24195
|
csp: noUnsafeEval,
|
23660
24196
|
expensiveChecks: true
|
23661
24197
|
};
|
24198
|
+
var runningChecksEnabled = false;
|
24199
|
+
|
24200
|
+
$parse.$$runningExpensiveChecks = function() {
|
24201
|
+
return runningChecksEnabled;
|
24202
|
+
};
|
24203
|
+
|
24204
|
+
return $parse;
|
23662
24205
|
|
23663
|
-
|
24206
|
+
function $parse(exp, interceptorFn, expensiveChecks) {
|
23664
24207
|
var parsedExpression, oneTime, cacheKey;
|
23665
24208
|
|
24209
|
+
expensiveChecks = expensiveChecks || runningChecksEnabled;
|
24210
|
+
|
23666
24211
|
switch (typeof exp) {
|
23667
24212
|
case 'string':
|
23668
24213
|
exp = exp.trim();
|
@@ -23688,6 +24233,9 @@ function $ParseProvider() {
|
|
23688
24233
|
} else if (parsedExpression.inputs) {
|
23689
24234
|
parsedExpression.$$watchDelegate = inputsWatchDelegate;
|
23690
24235
|
}
|
24236
|
+
if (expensiveChecks) {
|
24237
|
+
parsedExpression = expensiveChecksInterceptor(parsedExpression);
|
24238
|
+
}
|
23691
24239
|
cache[cacheKey] = parsedExpression;
|
23692
24240
|
}
|
23693
24241
|
return addInterceptor(parsedExpression, interceptorFn);
|
@@ -23698,7 +24246,31 @@ function $ParseProvider() {
|
|
23698
24246
|
default:
|
23699
24247
|
return addInterceptor(noop, interceptorFn);
|
23700
24248
|
}
|
23701
|
-
}
|
24249
|
+
}
|
24250
|
+
|
24251
|
+
function expensiveChecksInterceptor(fn) {
|
24252
|
+
if (!fn) return fn;
|
24253
|
+
expensiveCheckFn.$$watchDelegate = fn.$$watchDelegate;
|
24254
|
+
expensiveCheckFn.assign = expensiveChecksInterceptor(fn.assign);
|
24255
|
+
expensiveCheckFn.constant = fn.constant;
|
24256
|
+
expensiveCheckFn.literal = fn.literal;
|
24257
|
+
for (var i = 0; fn.inputs && i < fn.inputs.length; ++i) {
|
24258
|
+
fn.inputs[i] = expensiveChecksInterceptor(fn.inputs[i]);
|
24259
|
+
}
|
24260
|
+
expensiveCheckFn.inputs = fn.inputs;
|
24261
|
+
|
24262
|
+
return expensiveCheckFn;
|
24263
|
+
|
24264
|
+
function expensiveCheckFn(scope, locals, assign, inputs) {
|
24265
|
+
var expensiveCheckOldValue = runningChecksEnabled;
|
24266
|
+
runningChecksEnabled = true;
|
24267
|
+
try {
|
24268
|
+
return fn(scope, locals, assign, inputs);
|
24269
|
+
} finally {
|
24270
|
+
runningChecksEnabled = expensiveCheckOldValue;
|
24271
|
+
}
|
24272
|
+
}
|
24273
|
+
}
|
23702
24274
|
|
23703
24275
|
function expressionInputDirtyCheck(newValue, oldValueOfValue) {
|
23704
24276
|
|
@@ -23815,13 +24387,9 @@ function $ParseProvider() {
|
|
23815
24387
|
function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {
|
23816
24388
|
var unwatch;
|
23817
24389
|
return unwatch = scope.$watch(function constantWatch(scope) {
|
23818
|
-
return parsedExpression(scope);
|
23819
|
-
}, function constantListener(value, old, scope) {
|
23820
|
-
if (isFunction(listener)) {
|
23821
|
-
listener.apply(this, arguments);
|
23822
|
-
}
|
23823
24390
|
unwatch();
|
23824
|
-
|
24391
|
+
return parsedExpression(scope);
|
24392
|
+
}, listener, objectEquality);
|
23825
24393
|
}
|
23826
24394
|
|
23827
24395
|
function addInterceptor(parsedExpression, interceptorFn) {
|
@@ -23914,7 +24482,7 @@ function $ParseProvider() {
|
|
23914
24482
|
*
|
23915
24483
|
* Note: progress/notify callbacks are not currently supported via the ES6-style interface.
|
23916
24484
|
*
|
23917
|
-
* Note: unlike ES6
|
24485
|
+
* Note: unlike ES6 behavior, an exception thrown in the constructor function will NOT implicitly reject the promise.
|
23918
24486
|
*
|
23919
24487
|
* However, the more traditional CommonJS-style usage is still available, and documented below.
|
23920
24488
|
*
|
@@ -24104,18 +24672,6 @@ function $$QProvider() {
|
|
24104
24672
|
*/
|
24105
24673
|
function qFactory(nextTick, exceptionHandler) {
|
24106
24674
|
var $qMinErr = minErr('$q', TypeError);
|
24107
|
-
function callOnce(self, resolveFn, rejectFn) {
|
24108
|
-
var called = false;
|
24109
|
-
function wrap(fn) {
|
24110
|
-
return function(value) {
|
24111
|
-
if (called) return;
|
24112
|
-
called = true;
|
24113
|
-
fn.call(self, value);
|
24114
|
-
};
|
24115
|
-
}
|
24116
|
-
|
24117
|
-
return [wrap(resolveFn), wrap(rejectFn)];
|
24118
|
-
}
|
24119
24675
|
|
24120
24676
|
/**
|
24121
24677
|
* @ngdoc method
|
@@ -24128,7 +24684,12 @@ function qFactory(nextTick, exceptionHandler) {
|
|
24128
24684
|
* @returns {Deferred} Returns a new instance of deferred.
|
24129
24685
|
*/
|
24130
24686
|
var defer = function() {
|
24131
|
-
|
24687
|
+
var d = new Deferred();
|
24688
|
+
//Necessary to support unbound execution :/
|
24689
|
+
d.resolve = simpleBind(d, d.resolve);
|
24690
|
+
d.reject = simpleBind(d, d.reject);
|
24691
|
+
d.notify = simpleBind(d, d.notify);
|
24692
|
+
return d;
|
24132
24693
|
};
|
24133
24694
|
|
24134
24695
|
function Promise() {
|
@@ -24201,10 +24762,6 @@ function qFactory(nextTick, exceptionHandler) {
|
|
24201
24762
|
|
24202
24763
|
function Deferred() {
|
24203
24764
|
this.promise = new Promise();
|
24204
|
-
//Necessary to support unbound execution :/
|
24205
|
-
this.resolve = simpleBind(this, this.resolve);
|
24206
|
-
this.reject = simpleBind(this, this.reject);
|
24207
|
-
this.notify = simpleBind(this, this.notify);
|
24208
24765
|
}
|
24209
24766
|
|
24210
24767
|
extend(Deferred.prototype, {
|
@@ -24222,23 +24779,34 @@ function qFactory(nextTick, exceptionHandler) {
|
|
24222
24779
|
},
|
24223
24780
|
|
24224
24781
|
$$resolve: function(val) {
|
24225
|
-
var then
|
24226
|
-
|
24227
|
-
|
24782
|
+
var then;
|
24783
|
+
var that = this;
|
24784
|
+
var done = false;
|
24228
24785
|
try {
|
24229
24786
|
if ((isObject(val) || isFunction(val))) then = val && val.then;
|
24230
24787
|
if (isFunction(then)) {
|
24231
24788
|
this.promise.$$state.status = -1;
|
24232
|
-
then.call(val,
|
24789
|
+
then.call(val, resolvePromise, rejectPromise, simpleBind(this, this.notify));
|
24233
24790
|
} else {
|
24234
24791
|
this.promise.$$state.value = val;
|
24235
24792
|
this.promise.$$state.status = 1;
|
24236
24793
|
scheduleProcessQueue(this.promise.$$state);
|
24237
24794
|
}
|
24238
24795
|
} catch (e) {
|
24239
|
-
|
24796
|
+
rejectPromise(e);
|
24240
24797
|
exceptionHandler(e);
|
24241
24798
|
}
|
24799
|
+
|
24800
|
+
function resolvePromise(val) {
|
24801
|
+
if (done) return;
|
24802
|
+
done = true;
|
24803
|
+
that.$$resolve(val);
|
24804
|
+
}
|
24805
|
+
function rejectPromise(val) {
|
24806
|
+
if (done) return;
|
24807
|
+
done = true;
|
24808
|
+
that.$$reject(val);
|
24809
|
+
}
|
24242
24810
|
},
|
24243
24811
|
|
24244
24812
|
reject: function(reason) {
|
@@ -24427,11 +24995,6 @@ function qFactory(nextTick, exceptionHandler) {
|
|
24427
24995
|
throw $qMinErr('norslvr', "Expected resolverFn, got '{0}'", resolver);
|
24428
24996
|
}
|
24429
24997
|
|
24430
|
-
if (!(this instanceof Q)) {
|
24431
|
-
// More useful when $Q is the Promise itself.
|
24432
|
-
return new Q(resolver);
|
24433
|
-
}
|
24434
|
-
|
24435
24998
|
var deferred = new Deferred();
|
24436
24999
|
|
24437
25000
|
function resolveFn(value) {
|
@@ -24447,6 +25010,10 @@ function qFactory(nextTick, exceptionHandler) {
|
|
24447
25010
|
return deferred.promise;
|
24448
25011
|
};
|
24449
25012
|
|
25013
|
+
// Let's make the instanceof operator work for promises, so that
|
25014
|
+
// `new $q(fn) instanceof $q` would evaluate to true.
|
25015
|
+
$Q.prototype = Promise.prototype;
|
25016
|
+
|
24450
25017
|
$Q.defer = defer;
|
24451
25018
|
$Q.reject = reject;
|
24452
25019
|
$Q.when = when;
|
@@ -24580,8 +25147,8 @@ function $RootScopeProvider() {
|
|
24580
25147
|
return ChildScope;
|
24581
25148
|
}
|
24582
25149
|
|
24583
|
-
this.$get = ['$
|
24584
|
-
function($
|
25150
|
+
this.$get = ['$exceptionHandler', '$parse', '$browser',
|
25151
|
+
function($exceptionHandler, $parse, $browser) {
|
24585
25152
|
|
24586
25153
|
function destroyChildScope($event) {
|
24587
25154
|
$event.currentScope.$$destroyed = true;
|
@@ -24865,7 +25432,7 @@ function $RootScopeProvider() {
|
|
24865
25432
|
* - `newVal` contains the current value of the `watchExpression`
|
24866
25433
|
* - `oldVal` contains the previous value of the `watchExpression`
|
24867
25434
|
* - `scope` refers to the current scope
|
24868
|
-
* @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of
|
25435
|
+
* @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of
|
24869
25436
|
* comparing for reference equality.
|
24870
25437
|
* @returns {function()} Returns a deregistration function for this listener.
|
24871
25438
|
*/
|
@@ -25230,7 +25797,7 @@ function $RootScopeProvider() {
|
|
25230
25797
|
*
|
25231
25798
|
*/
|
25232
25799
|
$digest: function() {
|
25233
|
-
var watch, value, last,
|
25800
|
+
var watch, value, last, fn, get,
|
25234
25801
|
watchers,
|
25235
25802
|
length,
|
25236
25803
|
dirty, ttl = TTL,
|
@@ -25276,7 +25843,8 @@ function $RootScopeProvider() {
|
|
25276
25843
|
// Most common watches are on primitives, in which case we can short
|
25277
25844
|
// circuit it with === operator, only when === fails do we use .equals
|
25278
25845
|
if (watch) {
|
25279
|
-
|
25846
|
+
get = watch.get;
|
25847
|
+
if ((value = get(current)) !== (last = watch.last) &&
|
25280
25848
|
!(watch.eq
|
25281
25849
|
? equals(value, last)
|
25282
25850
|
: (typeof value === 'number' && typeof last === 'number'
|
@@ -25284,7 +25852,8 @@ function $RootScopeProvider() {
|
|
25284
25852
|
dirty = true;
|
25285
25853
|
lastDirtyWatch = watch;
|
25286
25854
|
watch.last = watch.eq ? copy(value, null) : value;
|
25287
|
-
watch.fn
|
25855
|
+
fn = watch.fn;
|
25856
|
+
fn(value, ((last === initWatchVal) ? value : last), current);
|
25288
25857
|
if (ttl < 5) {
|
25289
25858
|
logIdx = 4 - ttl;
|
25290
25859
|
if (!watchLog[logIdx]) watchLog[logIdx] = [];
|
@@ -25484,7 +26053,7 @@ function $RootScopeProvider() {
|
|
25484
26053
|
});
|
25485
26054
|
}
|
25486
26055
|
|
25487
|
-
asyncQueue.push({scope: this, expression: expr, locals: locals});
|
26056
|
+
asyncQueue.push({scope: this, expression: $parse(expr), locals: locals});
|
25488
26057
|
},
|
25489
26058
|
|
25490
26059
|
$$postDigest: function(fn) {
|
@@ -25576,6 +26145,7 @@ function $RootScopeProvider() {
|
|
25576
26145
|
$applyAsync: function(expr) {
|
25577
26146
|
var scope = this;
|
25578
26147
|
expr && applyAsyncQueue.push($applyAsyncExpression);
|
26148
|
+
expr = $parse(expr);
|
25579
26149
|
scheduleApplyAsync();
|
25580
26150
|
|
25581
26151
|
function $applyAsyncExpression() {
|
@@ -26079,13 +26649,15 @@ function $SceDelegateProvider() {
|
|
26079
26649
|
* @kind function
|
26080
26650
|
*
|
26081
26651
|
* @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value
|
26082
|
-
*
|
26083
|
-
*
|
26652
|
+
* provided. This must be an array or null. A snapshot of this array is used so further
|
26653
|
+
* changes to the array are ignored.
|
26084
26654
|
*
|
26085
|
-
*
|
26086
|
-
*
|
26655
|
+
* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
|
26656
|
+
* allowed in this array.
|
26087
26657
|
*
|
26088
|
-
*
|
26658
|
+
* <div class="alert alert-warning">
|
26659
|
+
* **Note:** an empty whitelist array will block all URLs!
|
26660
|
+
* </div>
|
26089
26661
|
*
|
26090
26662
|
* @return {Array} the currently set whitelist array.
|
26091
26663
|
*
|
@@ -26108,17 +26680,17 @@ function $SceDelegateProvider() {
|
|
26108
26680
|
* @kind function
|
26109
26681
|
*
|
26110
26682
|
* @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value
|
26111
|
-
*
|
26112
|
-
*
|
26683
|
+
* provided. This must be an array or null. A snapshot of this array is used so further
|
26684
|
+
* changes to the array are ignored.
|
26113
26685
|
*
|
26114
|
-
*
|
26115
|
-
*
|
26686
|
+
* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
|
26687
|
+
* allowed in this array.
|
26116
26688
|
*
|
26117
|
-
*
|
26118
|
-
*
|
26119
|
-
*
|
26689
|
+
* The typical usage for the blacklist is to **block
|
26690
|
+
* [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as
|
26691
|
+
* these would otherwise be trusted but actually return content from the redirected domain.
|
26120
26692
|
*
|
26121
|
-
*
|
26693
|
+
* Finally, **the blacklist overrides the whitelist** and has the final say.
|
26122
26694
|
*
|
26123
26695
|
* @return {Array} the currently set blacklist array.
|
26124
26696
|
*
|
@@ -26277,6 +26849,11 @@ function $SceDelegateProvider() {
|
|
26277
26849
|
* returns the originally supplied value if the queried context type is a supertype of the
|
26278
26850
|
* created type. If this condition isn't satisfied, throws an exception.
|
26279
26851
|
*
|
26852
|
+
* <div class="alert alert-danger">
|
26853
|
+
* Disabling auto-escaping is extremely dangerous, it usually creates a Cross Site Scripting
|
26854
|
+
* (XSS) vulnerability in your application.
|
26855
|
+
* </div>
|
26856
|
+
*
|
26280
26857
|
* @param {string} type The kind of context in which this value is to be used.
|
26281
26858
|
* @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs
|
26282
26859
|
* `$sceDelegate.trustAs`} call.
|
@@ -27084,26 +27661,63 @@ function $SnifferProvider() {
|
|
27084
27661
|
var $compileMinErr = minErr('$compile');
|
27085
27662
|
|
27086
27663
|
/**
|
27087
|
-
* @ngdoc
|
27088
|
-
* @name $
|
27089
|
-
*
|
27664
|
+
* @ngdoc provider
|
27665
|
+
* @name $templateRequestProvider
|
27090
27666
|
* @description
|
27091
|
-
*
|
27092
|
-
* `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
|
27093
|
-
* fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
|
27094
|
-
* exception can be thwarted by setting the 2nd parameter of the function to true). Note that the
|
27095
|
-
* contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted
|
27096
|
-
* when `tpl` is of type string and `$templateCache` has the matching entry.
|
27097
|
-
*
|
27098
|
-
* @param {string|TrustedResourceUrl} tpl The HTTP request template URL
|
27099
|
-
* @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty
|
27667
|
+
* Used to configure the options passed to the {@link $http} service when making a template request.
|
27100
27668
|
*
|
27101
|
-
*
|
27102
|
-
*
|
27103
|
-
* @property {number} totalPendingRequests total amount of pending template requests being downloaded.
|
27669
|
+
* For example, it can be used for specifying the "Accept" header that is sent to the server, when
|
27670
|
+
* requesting a template.
|
27104
27671
|
*/
|
27105
27672
|
function $TemplateRequestProvider() {
|
27673
|
+
|
27674
|
+
var httpOptions;
|
27675
|
+
|
27676
|
+
/**
|
27677
|
+
* @ngdoc method
|
27678
|
+
* @name $templateRequestProvider#httpOptions
|
27679
|
+
* @description
|
27680
|
+
* The options to be passed to the {@link $http} service when making the request.
|
27681
|
+
* You can use this to override options such as the "Accept" header for template requests.
|
27682
|
+
*
|
27683
|
+
* The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the
|
27684
|
+
* options if not overridden here.
|
27685
|
+
*
|
27686
|
+
* @param {string=} value new value for the {@link $http} options.
|
27687
|
+
* @returns {string|self} Returns the {@link $http} options when used as getter and self if used as setter.
|
27688
|
+
*/
|
27689
|
+
this.httpOptions = function(val) {
|
27690
|
+
if (val) {
|
27691
|
+
httpOptions = val;
|
27692
|
+
return this;
|
27693
|
+
}
|
27694
|
+
return httpOptions;
|
27695
|
+
};
|
27696
|
+
|
27697
|
+
/**
|
27698
|
+
* @ngdoc service
|
27699
|
+
* @name $templateRequest
|
27700
|
+
*
|
27701
|
+
* @description
|
27702
|
+
* The `$templateRequest` service runs security checks then downloads the provided template using
|
27703
|
+
* `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
|
27704
|
+
* fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
|
27705
|
+
* exception can be thwarted by setting the 2nd parameter of the function to true). Note that the
|
27706
|
+
* contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted
|
27707
|
+
* when `tpl` is of type string and `$templateCache` has the matching entry.
|
27708
|
+
*
|
27709
|
+
* If you want to pass custom options to the `$http` service, such as setting the Accept header you
|
27710
|
+
* can configure this via {@link $templateRequestProvider#httpOptions}.
|
27711
|
+
*
|
27712
|
+
* @param {string|TrustedResourceUrl} tpl The HTTP request template URL
|
27713
|
+
* @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty
|
27714
|
+
*
|
27715
|
+
* @return {Promise} a promise for the HTTP response data of the given URL.
|
27716
|
+
*
|
27717
|
+
* @property {number} totalPendingRequests total amount of pending template requests being downloaded.
|
27718
|
+
*/
|
27106
27719
|
this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce) {
|
27720
|
+
|
27107
27721
|
function handleRequestFn(tpl, ignoreRequestError) {
|
27108
27722
|
handleRequestFn.totalPendingRequests++;
|
27109
27723
|
|
@@ -27126,12 +27740,10 @@ function $TemplateRequestProvider() {
|
|
27126
27740
|
transformResponse = null;
|
27127
27741
|
}
|
27128
27742
|
|
27129
|
-
|
27130
|
-
|
27131
|
-
|
27132
|
-
|
27133
|
-
|
27134
|
-
return $http.get(tpl, httpOptions)
|
27743
|
+
return $http.get(tpl, extend({
|
27744
|
+
cache: $templateCache,
|
27745
|
+
transformResponse: transformResponse
|
27746
|
+
}, httpOptions))
|
27135
27747
|
['finally'](function() {
|
27136
27748
|
handleRequestFn.totalPendingRequests--;
|
27137
27749
|
})
|
@@ -28586,13 +29198,13 @@ function dateFilter($locale) {
|
|
28586
29198
|
|
28587
29199
|
var dateTimezoneOffset = date.getTimezoneOffset();
|
28588
29200
|
if (timezone) {
|
28589
|
-
dateTimezoneOffset = timezoneToOffset(timezone,
|
29201
|
+
dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
|
28590
29202
|
date = convertTimezoneToLocal(date, timezone, true);
|
28591
29203
|
}
|
28592
29204
|
forEach(parts, function(value) {
|
28593
29205
|
fn = DATE_FORMATS[value];
|
28594
29206
|
text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)
|
28595
|
-
: value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
|
29207
|
+
: value === "''" ? "'" : value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
|
28596
29208
|
});
|
28597
29209
|
|
28598
29210
|
return text;
|
@@ -28796,8 +29408,9 @@ function limitToFilter() {
|
|
28796
29408
|
* Orders a specified `array` by the `expression` predicate. It is ordered alphabetically
|
28797
29409
|
* for strings and numerically for numbers. Note: if you notice numbers are not being sorted
|
28798
29410
|
* as expected, make sure they are actually being saved as numbers and not strings.
|
29411
|
+
* Array-like values (e.g. NodeLists, jQuery objects, TypedArrays, Strings, etc) are also supported.
|
28799
29412
|
*
|
28800
|
-
* @param {Array} array The array to sort.
|
29413
|
+
* @param {Array} array The array (or array-like object) to sort.
|
28801
29414
|
* @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be
|
28802
29415
|
* used by the comparator to determine the order of elements.
|
28803
29416
|
*
|
@@ -28984,7 +29597,10 @@ orderByFilter.$inject = ['$parse'];
|
|
28984
29597
|
function orderByFilter($parse) {
|
28985
29598
|
return function(array, sortPredicate, reverseOrder) {
|
28986
29599
|
|
28987
|
-
if (
|
29600
|
+
if (array == null) return array;
|
29601
|
+
if (!isArrayLike(array)) {
|
29602
|
+
throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array);
|
29603
|
+
}
|
28988
29604
|
|
28989
29605
|
if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; }
|
28990
29606
|
if (sortPredicate.length === 0) { sortPredicate = ['+']; }
|
@@ -29694,7 +30310,7 @@ function FormController(element, attrs, $scope, $animate, $interpolate) {
|
|
29694
30310
|
*
|
29695
30311
|
* However, if the method is used programmatically, for example by adding dynamically created controls,
|
29696
30312
|
* or controls that have been previously removed without destroying their corresponding DOM element,
|
29697
|
-
* it's the developers
|
30313
|
+
* it's the developers responsibility to make sure the current state propagates to the parent form.
|
29698
30314
|
*
|
29699
30315
|
* For example, if an input control is added that is already `$dirty` and has `$error` properties,
|
29700
30316
|
* calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form.
|
@@ -30171,8 +30787,8 @@ var inputType = {
|
|
30171
30787
|
* @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
|
30172
30788
|
* that contains the regular expression body that will be converted to a regular expression
|
30173
30789
|
* as in the ngPattern directive.
|
30174
|
-
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel
|
30175
|
-
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
30790
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
|
30791
|
+
* does not match a RegExp found by evaluating the Angular expression given in the attribute value.
|
30176
30792
|
* If the expression evaluates to a RegExp object, then this is used directly.
|
30177
30793
|
* If the expression evaluates to a string, then it will be converted to a RegExp
|
30178
30794
|
* after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
|
@@ -30459,7 +31075,7 @@ var inputType = {
|
|
30459
31075
|
*
|
30460
31076
|
* @description
|
30461
31077
|
* Input with time validation and transformation. In browsers that do not yet support
|
30462
|
-
* the HTML5
|
31078
|
+
* the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
|
30463
31079
|
* local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a
|
30464
31080
|
* Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.
|
30465
31081
|
*
|
@@ -30806,8 +31422,8 @@ var inputType = {
|
|
30806
31422
|
* @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
|
30807
31423
|
* that contains the regular expression body that will be converted to a regular expression
|
30808
31424
|
* as in the ngPattern directive.
|
30809
|
-
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel
|
30810
|
-
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
31425
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
|
31426
|
+
* does not match a RegExp found by evaluating the Angular expression given in the attribute value.
|
30811
31427
|
* If the expression evaluates to a RegExp object, then this is used directly.
|
30812
31428
|
* If the expression evaluates to a string, then it will be converted to a RegExp
|
30813
31429
|
* after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
|
@@ -30904,8 +31520,8 @@ var inputType = {
|
|
30904
31520
|
* @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
|
30905
31521
|
* that contains the regular expression body that will be converted to a regular expression
|
30906
31522
|
* as in the ngPattern directive.
|
30907
|
-
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel
|
30908
|
-
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
31523
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
|
31524
|
+
* does not match a RegExp found by evaluating the Angular expression given in the attribute value.
|
30909
31525
|
* If the expression evaluates to a RegExp object, then this is used directly.
|
30910
31526
|
* If the expression evaluates to a string, then it will be converted to a RegExp
|
30911
31527
|
* after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
|
@@ -31003,8 +31619,8 @@ var inputType = {
|
|
31003
31619
|
* @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
|
31004
31620
|
* that contains the regular expression body that will be converted to a regular expression
|
31005
31621
|
* as in the ngPattern directive.
|
31006
|
-
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel
|
31007
|
-
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
31622
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
|
31623
|
+
* does not match a RegExp found by evaluating the Angular expression given in the attribute value.
|
31008
31624
|
* If the expression evaluates to a RegExp object, then this is used directly.
|
31009
31625
|
* If the expression evaluates to a string, then it will be converted to a RegExp
|
31010
31626
|
* after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
|
@@ -31464,11 +32080,7 @@ function badInputChecker(scope, element, attr, ctrl) {
|
|
31464
32080
|
if (nativeValidation) {
|
31465
32081
|
ctrl.$parsers.push(function(value) {
|
31466
32082
|
var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};
|
31467
|
-
|
31468
|
-
// - also sets validity.badInput (should only be validity.typeMismatch).
|
31469
|
-
// - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email)
|
31470
|
-
// - can ignore this case as we can still read out the erroneous email...
|
31471
|
-
return validity.badInput && !validity.typeMismatch ? undefined : value;
|
32083
|
+
return validity.badInput || validity.typeMismatch ? undefined : value;
|
31472
32084
|
});
|
31473
32085
|
}
|
31474
32086
|
}
|
@@ -31640,8 +32252,8 @@ function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filt
|
|
31640
32252
|
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
|
31641
32253
|
* maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any
|
31642
32254
|
* length.
|
31643
|
-
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel
|
31644
|
-
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
32255
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
|
32256
|
+
* does not match a RegExp found by evaluating the Angular expression given in the attribute value.
|
31645
32257
|
* If the expression evaluates to a RegExp object, then this is used directly.
|
31646
32258
|
* If the expression evaluates to a string, then it will be converted to a RegExp
|
31647
32259
|
* after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
|
@@ -31679,8 +32291,8 @@ function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filt
|
|
31679
32291
|
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
|
31680
32292
|
* maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any
|
31681
32293
|
* length.
|
31682
|
-
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel
|
31683
|
-
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
32294
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
|
32295
|
+
* value does not match a RegExp found by evaluating the Angular expression given in the attribute value.
|
31684
32296
|
* If the expression evaluates to a RegExp object, then this is used directly.
|
31685
32297
|
* If the expression evaluates to a string, then it will be converted to a RegExp
|
31686
32298
|
* after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
|
@@ -32906,7 +33518,7 @@ var ngControllerDirective = [function() {
|
|
32906
33518
|
*
|
32907
33519
|
* * no-inline-style: this stops Angular from injecting CSS styles into the DOM
|
32908
33520
|
*
|
32909
|
-
* * no-unsafe-eval: this stops Angular from
|
33521
|
+
* * no-unsafe-eval: this stops Angular from optimizing $parse with unsafe eval of strings
|
32910
33522
|
*
|
32911
33523
|
* You can use these values in the following combinations:
|
32912
33524
|
*
|
@@ -32923,7 +33535,7 @@ var ngControllerDirective = [function() {
|
|
32923
33535
|
* inline styles. E.g. `<body ng-csp="no-unsafe-eval">`.
|
32924
33536
|
*
|
32925
33537
|
* * Specifying only `no-inline-style` tells Angular that we must not inject styles, but that we can
|
32926
|
-
* run eval - no
|
33538
|
+
* run eval - no automatic check for unsafe eval will occur. E.g. `<body ng-csp="no-inline-style">`
|
32927
33539
|
*
|
32928
33540
|
* * Specifying both `no-unsafe-eval` and `no-inline-style` tells Angular that we must not inject
|
32929
33541
|
* styles nor use eval, which is the same as an empty: ng-csp.
|
@@ -33955,7 +34567,7 @@ var ngIncludeFillContentDirective = ['$compile',
|
|
33955
34567
|
priority: -400,
|
33956
34568
|
require: 'ngInclude',
|
33957
34569
|
link: function(scope, $element, $attr, ctrl) {
|
33958
|
-
if (
|
34570
|
+
if (toString.call($element[0]).match(/SVG/)) {
|
33959
34571
|
// WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not
|
33960
34572
|
// support innerHTML, so detect this here and try to generate the contents
|
33961
34573
|
// specially.
|
@@ -34184,7 +34796,9 @@ var VALID_CLASS = 'ng-valid',
|
|
34184
34796
|
DIRTY_CLASS = 'ng-dirty',
|
34185
34797
|
UNTOUCHED_CLASS = 'ng-untouched',
|
34186
34798
|
TOUCHED_CLASS = 'ng-touched',
|
34187
|
-
PENDING_CLASS = 'ng-pending'
|
34799
|
+
PENDING_CLASS = 'ng-pending',
|
34800
|
+
EMPTY_CLASS = 'ng-empty',
|
34801
|
+
NOT_EMPTY_CLASS = 'ng-not-empty';
|
34188
34802
|
|
34189
34803
|
var ngModelMinErr = minErr('ngModel');
|
34190
34804
|
|
@@ -34488,6 +35102,17 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
|
34488
35102
|
return isUndefined(value) || value === '' || value === null || value !== value;
|
34489
35103
|
};
|
34490
35104
|
|
35105
|
+
this.$$updateEmptyClasses = function(value) {
|
35106
|
+
if (ctrl.$isEmpty(value)) {
|
35107
|
+
$animate.removeClass($element, NOT_EMPTY_CLASS);
|
35108
|
+
$animate.addClass($element, EMPTY_CLASS);
|
35109
|
+
} else {
|
35110
|
+
$animate.removeClass($element, EMPTY_CLASS);
|
35111
|
+
$animate.addClass($element, NOT_EMPTY_CLASS);
|
35112
|
+
}
|
35113
|
+
};
|
35114
|
+
|
35115
|
+
|
34491
35116
|
var currentValidationRunId = 0;
|
34492
35117
|
|
34493
35118
|
/**
|
@@ -34851,6 +35476,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
|
34851
35476
|
if (ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)) {
|
34852
35477
|
return;
|
34853
35478
|
}
|
35479
|
+
ctrl.$$updateEmptyClasses(viewValue);
|
34854
35480
|
ctrl.$$lastCommittedViewValue = viewValue;
|
34855
35481
|
|
34856
35482
|
// change to dirty
|
@@ -34949,7 +35575,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
|
34949
35575
|
* However, custom controls might also pass objects to this method. In this case, we should make
|
34950
35576
|
* a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not
|
34951
35577
|
* perform a deep watch of objects, it only looks for a change of identity. If you only change
|
34952
|
-
* the property of the object then ngModel will not
|
35578
|
+
* the property of the object then ngModel will not realize that the object has changed and
|
34953
35579
|
* will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should
|
34954
35580
|
* not change properties of the copy once it has been passed to `$setViewValue`.
|
34955
35581
|
* Otherwise you may cause the model value on the scope to change incorrectly.
|
@@ -35033,6 +35659,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
|
35033
35659
|
viewValue = formatters[idx](viewValue);
|
35034
35660
|
}
|
35035
35661
|
if (ctrl.$viewValue !== viewValue) {
|
35662
|
+
ctrl.$$updateEmptyClasses(viewValue);
|
35036
35663
|
ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;
|
35037
35664
|
ctrl.$render();
|
35038
35665
|
|
@@ -35063,7 +35690,8 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
|
35063
35690
|
* require.
|
35064
35691
|
* - Providing validation behavior (i.e. required, number, email, url).
|
35065
35692
|
* - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).
|
35066
|
-
* - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`,
|
35693
|
+
* - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`,
|
35694
|
+
* `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations.
|
35067
35695
|
* - Registering the control with its parent {@link ng.directive:form form}.
|
35068
35696
|
*
|
35069
35697
|
* Note: `ngModel` will try to bind to the property given by evaluating the expression on the
|
@@ -35091,6 +35719,22 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
|
35091
35719
|
* - {@link ng.directive:select select}
|
35092
35720
|
* - {@link ng.directive:textarea textarea}
|
35093
35721
|
*
|
35722
|
+
* # Complex Models (objects or collections)
|
35723
|
+
*
|
35724
|
+
* By default, `ngModel` watches the model by reference, not value. This is important to know when
|
35725
|
+
* binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the
|
35726
|
+
* object or collection change, `ngModel` will not be notified and so the input will not be re-rendered.
|
35727
|
+
*
|
35728
|
+
* The model must be assigned an entirely new object or collection before a re-rendering will occur.
|
35729
|
+
*
|
35730
|
+
* Some directives have options that will cause them to use a custom `$watchCollection` on the model expression
|
35731
|
+
* - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or
|
35732
|
+
* if the select is given the `multiple` attribute.
|
35733
|
+
*
|
35734
|
+
* The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the
|
35735
|
+
* first level of the object (or only changing the properties of an item in the collection if it's an array) will still
|
35736
|
+
* not trigger a re-rendering of the model.
|
35737
|
+
*
|
35094
35738
|
* # CSS classes
|
35095
35739
|
* The following CSS classes are added and removed on the associated input/select/textarea element
|
35096
35740
|
* depending on the validity of the model.
|
@@ -35104,13 +35748,16 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
|
35104
35748
|
* - `ng-touched`: the control has been blurred
|
35105
35749
|
* - `ng-untouched`: the control hasn't been blurred
|
35106
35750
|
* - `ng-pending`: any `$asyncValidators` are unfulfilled
|
35751
|
+
* - `ng-empty`: the view does not contain a value or the value is deemed "empty", as defined
|
35752
|
+
* by the {@link ngModel.NgModelController#$isEmpty} method
|
35753
|
+
* - `ng-not-empty`: the view contains a non-empty value
|
35107
35754
|
*
|
35108
35755
|
* Keep in mind that ngAnimate can detect each of these classes when added and removed.
|
35109
35756
|
*
|
35110
35757
|
* ## Animation Hooks
|
35111
35758
|
*
|
35112
35759
|
* Animations within models are triggered when any of the associated CSS classes are added and removed
|
35113
|
-
* on the input element which is attached to the model. These classes
|
35760
|
+
* on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`,
|
35114
35761
|
* `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.
|
35115
35762
|
* The animations that are triggered within ngModel are similar to how they work in ngClass and
|
35116
35763
|
* animations can be hooked into using CSS transitions, keyframes as well as JS animations.
|
@@ -36003,14 +36650,10 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
36003
36650
|
var optionTemplate = document.createElement('option'),
|
36004
36651
|
optGroupTemplate = document.createElement('optgroup');
|
36005
36652
|
|
36006
|
-
|
36007
36653
|
function ngOptionsPostLink(scope, selectElement, attr, ctrls) {
|
36008
36654
|
|
36009
|
-
// if ngModel is not defined, we don't need to do anything
|
36010
|
-
var ngModelCtrl = ctrls[1];
|
36011
|
-
if (!ngModelCtrl) return;
|
36012
|
-
|
36013
36655
|
var selectCtrl = ctrls[0];
|
36656
|
+
var ngModelCtrl = ctrls[1];
|
36014
36657
|
var multiple = attr.multiple;
|
36015
36658
|
|
36016
36659
|
// The emptyOption allows the application developer to provide their own custom "empty"
|
@@ -36270,7 +36913,7 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
36270
36913
|
var groupElement;
|
36271
36914
|
var optionElement;
|
36272
36915
|
|
36273
|
-
if (option.group) {
|
36916
|
+
if (isDefined(option.group)) {
|
36274
36917
|
|
36275
36918
|
// This option is to live in a group
|
36276
36919
|
// See if we have already created this group
|
@@ -36344,7 +36987,7 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
36344
36987
|
return {
|
36345
36988
|
restrict: 'A',
|
36346
36989
|
terminal: true,
|
36347
|
-
require: ['select', '
|
36990
|
+
require: ['select', 'ngModel'],
|
36348
36991
|
link: {
|
36349
36992
|
pre: function ngOptionsPreLink(scope, selectElement, attr, ctrls) {
|
36350
36993
|
// Deactivate the SelectController.register method to prevent
|
@@ -36572,7 +37215,7 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale,
|
|
36572
37215
|
}
|
36573
37216
|
|
36574
37217
|
// If both `count` and `lastCount` are NaN, we don't need to re-register a watch.
|
36575
|
-
// In JS `NaN !== NaN`, so we have to
|
37218
|
+
// In JS `NaN !== NaN`, so we have to explicitly check.
|
36576
37219
|
if ((count !== lastCount) && !(countIsNaN && isNumber(lastCount) && isNaN(lastCount))) {
|
36577
37220
|
watchRemover();
|
36578
37221
|
var whenExpFn = whensExpFns[count];
|
@@ -36689,7 +37332,7 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale,
|
|
36689
37332
|
* by the identifier instead of the whole object. Should you reload your data later, `ngRepeat`
|
36690
37333
|
* will not have to rebuild the DOM elements for items it has already rendered, even if the
|
36691
37334
|
* JavaScript objects in the collection have been substituted for new ones. For large collections,
|
36692
|
-
* this
|
37335
|
+
* this significantly improves rendering performance. If you don't have a unique identifier,
|
36693
37336
|
* `track by $index` can also provide a performance boost.
|
36694
37337
|
* </div>
|
36695
37338
|
* ```html
|
@@ -36766,6 +37409,8 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale,
|
|
36766
37409
|
*
|
36767
37410
|
* **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered
|
36768
37411
|
*
|
37412
|
+
* See the example below for defining CSS animations with ngRepeat.
|
37413
|
+
*
|
36769
37414
|
* @element ANY
|
36770
37415
|
* @scope
|
36771
37416
|
* @priority 1000
|
@@ -36818,22 +37463,11 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale,
|
|
36818
37463
|
* For example: `item in items | filter : x | orderBy : order | limitTo : limit as results` .
|
36819
37464
|
*
|
36820
37465
|
* @example
|
36821
|
-
* This example
|
36822
|
-
*
|
36823
|
-
<example module="
|
37466
|
+
* This example uses `ngRepeat` to display a list of people. A filter is used to restrict the displayed
|
37467
|
+
* results by name. New (entering) and removed (leaving) items are animated.
|
37468
|
+
<example module="ngRepeat" name="ngRepeat" deps="angular-animate.js" animations="true">
|
36824
37469
|
<file name="index.html">
|
36825
|
-
<div ng-
|
36826
|
-
{name:'John', age:25, gender:'boy'},
|
36827
|
-
{name:'Jessie', age:30, gender:'girl'},
|
36828
|
-
{name:'Johanna', age:28, gender:'girl'},
|
36829
|
-
{name:'Joy', age:15, gender:'girl'},
|
36830
|
-
{name:'Mary', age:28, gender:'girl'},
|
36831
|
-
{name:'Peter', age:95, gender:'boy'},
|
36832
|
-
{name:'Sebastian', age:50, gender:'boy'},
|
36833
|
-
{name:'Erika', age:27, gender:'girl'},
|
36834
|
-
{name:'Patrick', age:40, gender:'boy'},
|
36835
|
-
{name:'Samantha', age:60, gender:'girl'}
|
36836
|
-
]">
|
37470
|
+
<div ng-controller="repeatController">
|
36837
37471
|
I have {{friends.length}} friends. They are:
|
36838
37472
|
<input type="search" ng-model="q" placeholder="filter friends..." aria-label="filter friends" />
|
36839
37473
|
<ul class="example-animate-container">
|
@@ -36846,6 +37480,22 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale,
|
|
36846
37480
|
</ul>
|
36847
37481
|
</div>
|
36848
37482
|
</file>
|
37483
|
+
<file name="script.js">
|
37484
|
+
angular.module('ngRepeat', ['ngAnimate']).controller('repeatController', function($scope) {
|
37485
|
+
$scope.friends = [
|
37486
|
+
{name:'John', age:25, gender:'boy'},
|
37487
|
+
{name:'Jessie', age:30, gender:'girl'},
|
37488
|
+
{name:'Johanna', age:28, gender:'girl'},
|
37489
|
+
{name:'Joy', age:15, gender:'girl'},
|
37490
|
+
{name:'Mary', age:28, gender:'girl'},
|
37491
|
+
{name:'Peter', age:95, gender:'boy'},
|
37492
|
+
{name:'Sebastian', age:50, gender:'boy'},
|
37493
|
+
{name:'Erika', age:27, gender:'girl'},
|
37494
|
+
{name:'Patrick', age:40, gender:'boy'},
|
37495
|
+
{name:'Samantha', age:60, gender:'girl'}
|
37496
|
+
];
|
37497
|
+
});
|
37498
|
+
</file>
|
36849
37499
|
<file name="animations.css">
|
36850
37500
|
.example-animate-container {
|
36851
37501
|
background:white;
|
@@ -36856,7 +37506,7 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale,
|
|
36856
37506
|
}
|
36857
37507
|
|
36858
37508
|
.animate-repeat {
|
36859
|
-
line-height:
|
37509
|
+
line-height:30px;
|
36860
37510
|
list-style:none;
|
36861
37511
|
box-sizing:border-box;
|
36862
37512
|
}
|
@@ -36878,7 +37528,7 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale,
|
|
36878
37528
|
.animate-repeat.ng-move.ng-move-active,
|
36879
37529
|
.animate-repeat.ng-enter.ng-enter-active {
|
36880
37530
|
opacity:1;
|
36881
|
-
max-height:
|
37531
|
+
max-height:30px;
|
36882
37532
|
}
|
36883
37533
|
</file>
|
36884
37534
|
<file name="protractor.js" type="protractor">
|
@@ -37735,67 +38385,186 @@ var ngSwitchDefaultDirective = ngDirective({
|
|
37735
38385
|
* @description
|
37736
38386
|
* Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.
|
37737
38387
|
*
|
37738
|
-
*
|
38388
|
+
* You can specify that you want to insert a named transclusion slot, instead of the default slot, by providing the slot name
|
38389
|
+
* as the value of the `ng-transclude` or `ng-transclude-slot` attribute.
|
38390
|
+
*
|
38391
|
+
* If the transcluded content is not empty (i.e. contains one or more DOM nodes, including whitespace text nodes), any existing
|
38392
|
+
* content of this element will be removed before the transcluded content is inserted.
|
38393
|
+
* If the transcluded content is empty, the existing content is left intact. This lets you provide fallback content in the case
|
38394
|
+
* that no transcluded content is provided.
|
37739
38395
|
*
|
37740
38396
|
* @element ANY
|
37741
38397
|
*
|
38398
|
+
* @param {string} ngTransclude|ngTranscludeSlot the name of the slot to insert at this point. If this is not provided, is empty
|
38399
|
+
* or its value is the same as the name of the attribute then the default slot is used.
|
38400
|
+
*
|
37742
38401
|
* @example
|
37743
|
-
|
37744
|
-
|
37745
|
-
|
37746
|
-
|
37747
|
-
|
37748
|
-
|
37749
|
-
|
37750
|
-
|
37751
|
-
|
37752
|
-
|
37753
|
-
|
37754
|
-
|
37755
|
-
'</div>'
|
37756
|
-
|
37757
|
-
|
37758
|
-
|
37759
|
-
|
37760
|
-
|
37761
|
-
|
37762
|
-
|
37763
|
-
|
37764
|
-
|
37765
|
-
|
37766
|
-
|
37767
|
-
|
37768
|
-
|
37769
|
-
|
37770
|
-
|
37771
|
-
|
37772
|
-
|
37773
|
-
|
37774
|
-
|
37775
|
-
|
37776
|
-
|
37777
|
-
|
37778
|
-
|
37779
|
-
|
37780
|
-
|
37781
|
-
|
38402
|
+
* ### Basic transclusion
|
38403
|
+
* This example demonstrates basic transclusion of content into a component directive.
|
38404
|
+
* <example name="simpleTranscludeExample" module="transcludeExample">
|
38405
|
+
* <file name="index.html">
|
38406
|
+
* <script>
|
38407
|
+
* angular.module('transcludeExample', [])
|
38408
|
+
* .directive('pane', function(){
|
38409
|
+
* return {
|
38410
|
+
* restrict: 'E',
|
38411
|
+
* transclude: true,
|
38412
|
+
* scope: { title:'@' },
|
38413
|
+
* template: '<div style="border: 1px solid black;">' +
|
38414
|
+
* '<div style="background-color: gray">{{title}}</div>' +
|
38415
|
+
* '<ng-transclude></ng-transclude>' +
|
38416
|
+
* '</div>'
|
38417
|
+
* };
|
38418
|
+
* })
|
38419
|
+
* .controller('ExampleController', ['$scope', function($scope) {
|
38420
|
+
* $scope.title = 'Lorem Ipsum';
|
38421
|
+
* $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';
|
38422
|
+
* }]);
|
38423
|
+
* </script>
|
38424
|
+
* <div ng-controller="ExampleController">
|
38425
|
+
* <input ng-model="title" aria-label="title"> <br/>
|
38426
|
+
* <textarea ng-model="text" aria-label="text"></textarea> <br/>
|
38427
|
+
* <pane title="{{title}}">{{text}}</pane>
|
38428
|
+
* </div>
|
38429
|
+
* </file>
|
38430
|
+
* <file name="protractor.js" type="protractor">
|
38431
|
+
* it('should have transcluded', function() {
|
38432
|
+
* var titleElement = element(by.model('title'));
|
38433
|
+
* titleElement.clear();
|
38434
|
+
* titleElement.sendKeys('TITLE');
|
38435
|
+
* var textElement = element(by.model('text'));
|
38436
|
+
* textElement.clear();
|
38437
|
+
* textElement.sendKeys('TEXT');
|
38438
|
+
* expect(element(by.binding('title')).getText()).toEqual('TITLE');
|
38439
|
+
* expect(element(by.binding('text')).getText()).toEqual('TEXT');
|
38440
|
+
* });
|
38441
|
+
* </file>
|
38442
|
+
* </example>
|
38443
|
+
*
|
38444
|
+
* @example
|
38445
|
+
* ### Transclude fallback content
|
38446
|
+
* This example shows how to use `NgTransclude` with fallback content, that
|
38447
|
+
* is displayed if no transcluded content is provided.
|
38448
|
+
*
|
38449
|
+
* <example module="transcludeFallbackContentExample">
|
38450
|
+
* <file name="index.html">
|
38451
|
+
* <script>
|
38452
|
+
* angular.module('transcludeFallbackContentExample', [])
|
38453
|
+
* .directive('myButton', function(){
|
38454
|
+
* return {
|
38455
|
+
* restrict: 'E',
|
38456
|
+
* transclude: true,
|
38457
|
+
* scope: true,
|
38458
|
+
* template: '<button style="cursor: pointer;">' +
|
38459
|
+
* '<ng-transclude>' +
|
38460
|
+
* '<b style="color: red;">Button1</b>' +
|
38461
|
+
* '</ng-transclude>' +
|
38462
|
+
* '</button>'
|
38463
|
+
* };
|
38464
|
+
* });
|
38465
|
+
* </script>
|
38466
|
+
* <!-- fallback button content -->
|
38467
|
+
* <my-button id="fallback"></my-button>
|
38468
|
+
* <!-- modified button content -->
|
38469
|
+
* <my-button id="modified">
|
38470
|
+
* <i style="color: green;">Button2</i>
|
38471
|
+
* </my-button>
|
38472
|
+
* </file>
|
38473
|
+
* <file name="protractor.js" type="protractor">
|
38474
|
+
* it('should have different transclude element content', function() {
|
38475
|
+
* expect(element(by.id('fallback')).getText()).toBe('Button1');
|
38476
|
+
* expect(element(by.id('modified')).getText()).toBe('Button2');
|
38477
|
+
* });
|
38478
|
+
* </file>
|
38479
|
+
* </example>
|
37782
38480
|
*
|
38481
|
+
* @example
|
38482
|
+
* ### Multi-slot transclusion
|
38483
|
+
* This example demonstrates using multi-slot transclusion in a component directive.
|
38484
|
+
* <example name="multiSlotTranscludeExample" module="multiSlotTranscludeExample">
|
38485
|
+
* <file name="index.html">
|
38486
|
+
* <style>
|
38487
|
+
* .title, .footer {
|
38488
|
+
* background-color: gray
|
38489
|
+
* }
|
38490
|
+
* </style>
|
38491
|
+
* <div ng-controller="ExampleController">
|
38492
|
+
* <input ng-model="title" aria-label="title"> <br/>
|
38493
|
+
* <textarea ng-model="text" aria-label="text"></textarea> <br/>
|
38494
|
+
* <pane>
|
38495
|
+
* <pane-title><a ng-href="{{link}}">{{title}}</a></pane-title>
|
38496
|
+
* <pane-body><p>{{text}}</p></pane-body>
|
38497
|
+
* </pane>
|
38498
|
+
* </div>
|
38499
|
+
* </file>
|
38500
|
+
* <file name="app.js">
|
38501
|
+
* angular.module('multiSlotTranscludeExample', [])
|
38502
|
+
* .directive('pane', function(){
|
38503
|
+
* return {
|
38504
|
+
* restrict: 'E',
|
38505
|
+
* transclude: {
|
38506
|
+
* 'title': '?paneTitle',
|
38507
|
+
* 'body': 'paneBody',
|
38508
|
+
* 'footer': '?paneFooter'
|
38509
|
+
* },
|
38510
|
+
* template: '<div style="border: 1px solid black;">' +
|
38511
|
+
* '<div class="title" ng-transclude="title">Fallback Title</div>' +
|
38512
|
+
* '<div ng-transclude="body"></div>' +
|
38513
|
+
* '<div class="footer" ng-transclude="footer">Fallback Footer</div>' +
|
38514
|
+
* '</div>'
|
38515
|
+
* };
|
38516
|
+
* })
|
38517
|
+
* .controller('ExampleController', ['$scope', function($scope) {
|
38518
|
+
* $scope.title = 'Lorem Ipsum';
|
38519
|
+
* $scope.link = "https://google.com";
|
38520
|
+
* $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';
|
38521
|
+
* }]);
|
38522
|
+
* </file>
|
38523
|
+
* <file name="protractor.js" type="protractor">
|
38524
|
+
* it('should have transcluded the title and the body', function() {
|
38525
|
+
* var titleElement = element(by.model('title'));
|
38526
|
+
* titleElement.clear();
|
38527
|
+
* titleElement.sendKeys('TITLE');
|
38528
|
+
* var textElement = element(by.model('text'));
|
38529
|
+
* textElement.clear();
|
38530
|
+
* textElement.sendKeys('TEXT');
|
38531
|
+
* expect(element(by.css('.title')).getText()).toEqual('TITLE');
|
38532
|
+
* expect(element(by.binding('text')).getText()).toEqual('TEXT');
|
38533
|
+
* expect(element(by.css('.footer')).getText()).toEqual('Fallback Footer');
|
38534
|
+
* });
|
38535
|
+
* </file>
|
38536
|
+
* </example>
|
37783
38537
|
*/
|
38538
|
+
var ngTranscludeMinErr = minErr('ngTransclude');
|
37784
38539
|
var ngTranscludeDirective = ngDirective({
|
37785
38540
|
restrict: 'EAC',
|
37786
38541
|
link: function($scope, $element, $attrs, controller, $transclude) {
|
38542
|
+
|
38543
|
+
if ($attrs.ngTransclude === $attrs.$attr.ngTransclude) {
|
38544
|
+
// If the attribute is of the form: `ng-transclude="ng-transclude"`
|
38545
|
+
// then treat it like the default
|
38546
|
+
$attrs.ngTransclude = '';
|
38547
|
+
}
|
38548
|
+
|
38549
|
+
function ngTranscludeCloneAttachFn(clone) {
|
38550
|
+
if (clone.length) {
|
38551
|
+
$element.empty();
|
38552
|
+
$element.append(clone);
|
38553
|
+
}
|
38554
|
+
}
|
38555
|
+
|
37787
38556
|
if (!$transclude) {
|
37788
|
-
throw
|
38557
|
+
throw ngTranscludeMinErr('orphan',
|
37789
38558
|
'Illegal use of ngTransclude directive in the template! ' +
|
37790
38559
|
'No parent directive that requires a transclusion found. ' +
|
37791
38560
|
'Element: {0}',
|
37792
38561
|
startingTag($element));
|
37793
38562
|
}
|
37794
38563
|
|
37795
|
-
|
37796
|
-
|
37797
|
-
|
37798
|
-
|
38564
|
+
// If there is no slot name defined or the slot name is not optional
|
38565
|
+
// then transclude the slot
|
38566
|
+
var slotName = $attrs.ngTransclude || $attrs.ngTranscludeSlot;
|
38567
|
+
$transclude(ngTranscludeCloneAttachFn, null, slotName);
|
37799
38568
|
}
|
37800
38569
|
});
|
37801
38570
|
|
@@ -37927,6 +38696,9 @@ var SelectController =
|
|
37927
38696
|
|
37928
38697
|
// Tell the select control that an option, with the given value, has been added
|
37929
38698
|
self.addOption = function(value, element) {
|
38699
|
+
// Skip comment nodes, as they only pollute the `optionsMap`
|
38700
|
+
if (element[0].nodeType === NODE_TYPE_COMMENT) return;
|
38701
|
+
|
37930
38702
|
assertNotHasOwnProperty(value, '"option value"');
|
37931
38703
|
if (value === '') {
|
37932
38704
|
self.emptyOption = element;
|
@@ -38011,7 +38783,7 @@ var SelectController =
|
|
38011
38783
|
*
|
38012
38784
|
* <div class="alert alert-warning">
|
38013
38785
|
* Note that the value of a `select` directive used without `ngOptions` is always a string.
|
38014
|
-
* When the model needs to be bound to a non-string value, you must either
|
38786
|
+
* When the model needs to be bound to a non-string value, you must either explicitly convert it
|
38015
38787
|
* using a directive (see example below) or use `ngOptions` to specify the set of options.
|
38016
38788
|
* This is because an option element can only be bound to string values at present.
|
38017
38789
|
* </div>
|
@@ -38299,7 +39071,6 @@ var optionDirective = ['$interpolate', function($interpolate) {
|
|
38299
39071
|
restrict: 'E',
|
38300
39072
|
priority: 100,
|
38301
39073
|
compile: function(element, attr) {
|
38302
|
-
|
38303
39074
|
if (isDefined(attr.value)) {
|
38304
39075
|
// If the value attribute is defined, check if it contains an interpolation
|
38305
39076
|
var interpolateValueFn = $interpolate(attr.value, true);
|
@@ -38313,7 +39084,6 @@ var optionDirective = ['$interpolate', function($interpolate) {
|
|
38313
39084
|
}
|
38314
39085
|
|
38315
39086
|
return function(scope, element, attr) {
|
38316
|
-
|
38317
39087
|
// This is an optimization over using ^^ since we don't want to have to search
|
38318
39088
|
// all the way to the root of the DOM for every single option element
|
38319
39089
|
var selectCtrlName = '$selectController',
|
@@ -38350,7 +39120,7 @@ var styleDirective = valueFn({
|
|
38350
39120
|
* for more info.
|
38351
39121
|
*
|
38352
39122
|
* The validator will set the `required` error key to true if the `required` attribute is set and
|
38353
|
-
* calling {@link ngModel.NgModelController#$isEmpty `NgModelController.$isEmpty` with the
|
39123
|
+
* calling {@link ngModel.NgModelController#$isEmpty `NgModelController.$isEmpty`} with the
|
38354
39124
|
* {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} returns `true`. For example, the
|
38355
39125
|
* `$isEmpty()` implementation for `input[text]` checks the length of the `$viewValue`. When developing
|
38356
39126
|
* custom controls, `$isEmpty()` can be overwritten to account for a $viewValue that is not string-based.
|
@@ -38836,6 +39606,7 @@ $provide.value("$locale", {
|
|
38836
39606
|
]
|
38837
39607
|
},
|
38838
39608
|
"id": "en-us",
|
39609
|
+
"localeID": "en_US",
|
38839
39610
|
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
|
38840
39611
|
});
|
38841
39612
|
}]);
|