|
138 | 138 | * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.
|
139 | 139 | */
|
140 | 140 |
|
| 141 | +var $compileMinErr = minErr('$compile'); |
141 | 142 |
|
142 | 143 | /**
|
143 | 144 | * @ngdoc service
|
@@ -589,7 +590,7 @@ function $CompileProvider($provide) {
|
589 | 590 | var startNode = node;
|
590 | 591 | do {
|
591 | 592 | if (!node) {
|
592 |
| - throw ngError(51, "Unterminated attribute, found '{0}' but no matching '{1}' found.", attrStart, attrEnd); |
| 593 | + throw $compileMinErr('utrat', "Unterminated attribute, found '{0}' but no matching '{1}' found.", attrStart, attrEnd); |
593 | 594 | }
|
594 | 595 | if (node.nodeType == 1 /** Element **/) {
|
595 | 596 | if (node.hasAttribute(attrStart)) depth++;
|
@@ -721,7 +722,7 @@ function $CompileProvider($provide) {
|
721 | 722 | compileNode = $template[0];
|
722 | 723 |
|
723 | 724 | if ($template.length != 1 || compileNode.nodeType !== 1) {
|
724 |
| - throw ngError(12, "Template for directive '{0}' must have exactly one root element.", directiveName); |
| 725 | + throw $compileMinErr('tplrt', "Template for directive '{0}' must have exactly one root element. {1}", directiveName, ''); |
725 | 726 | }
|
726 | 727 |
|
727 | 728 | replaceWith(jqCollection, $compileNode, compileNode);
|
@@ -809,7 +810,7 @@ function $CompileProvider($provide) {
|
809 | 810 | }
|
810 | 811 | value = $element[retrievalMethod]('$' + require + 'Controller');
|
811 | 812 | if (!value && !optional) {
|
812 |
| - throw ngError(13, "Controller '{0}', required by directive '{1}', can't be found!", require, directiveName); |
| 813 | + throw $compileMinErr('ctreq', "Controller '{0}', required by directive '{1}', can't be found!", require, directiveName); |
813 | 814 | }
|
814 | 815 | return value;
|
815 | 816 | } else if (isArray(require)) {
|
@@ -869,7 +870,7 @@ function $CompileProvider($provide) {
|
869 | 870 | parentSet = parentGet.assign || function() {
|
870 | 871 | // reset the change, or we will throw this exception on every $digest
|
871 | 872 | lastValue = scope[scopeName] = parentGet(parentScope);
|
872 |
| - throw ngError(14, "Expression '{0}' used with directive '{1}' is non-assignable!", |
| 873 | + throw $compileMinErr('noass', "Expression '{0}' used with directive '{1}' is non-assignable!", |
873 | 874 | attrs[attrName], newIsolateScopeDirective.name);
|
874 | 875 | };
|
875 | 876 | lastValue = scope[scopeName] = parentGet(parentScope);
|
@@ -900,7 +901,7 @@ function $CompileProvider($provide) {
|
900 | 901 | }
|
901 | 902 |
|
902 | 903 | default: {
|
903 |
| - throw ngError(15, "Invalid isolate scope definition for directive '{0}'. Definition: {... {1}: '{2}' ...}", |
| 904 | + throw $compileMinErr('iscp', "Invalid isolate scope definition for directive '{0}'. Definition: {... {1}: '{2}' ...}", |
904 | 905 | newIsolateScopeDirective.name, scopeName, definition);
|
905 | 906 | }
|
906 | 907 | }
|
@@ -1057,7 +1058,7 @@ function $CompileProvider($provide) {
|
1057 | 1058 | compileNode = $template[0];
|
1058 | 1059 |
|
1059 | 1060 | if ($template.length != 1 || compileNode.nodeType !== 1) {
|
1060 |
| - throw ngError(16, "Template for directive '{0}' must have exactly one root element. Template: {1}", |
| 1061 | + throw $compileMinErr('tplrt', "Template for directive '{0}' must have exactly one root element. {1}", |
1061 | 1062 | origAsyncDirective.name, templateUrl);
|
1062 | 1063 | }
|
1063 | 1064 |
|
@@ -1095,7 +1096,7 @@ function $CompileProvider($provide) {
|
1095 | 1096 | linkQueue = null;
|
1096 | 1097 | }).
|
1097 | 1098 | error(function(response, code, headers, config) {
|
1098 |
| - throw ngError(17, 'Failed to load template: {0}', config.url); |
| 1099 | + throw $compileMinErr('tpload', 'Failed to load template: {0}', config.url); |
1099 | 1100 | });
|
1100 | 1101 |
|
1101 | 1102 | return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, controller) {
|
@@ -1123,7 +1124,7 @@ function $CompileProvider($provide) {
|
1123 | 1124 |
|
1124 | 1125 | function assertNoDuplicate(what, previousDirective, directive, element) {
|
1125 | 1126 | if (previousDirective) {
|
1126 |
| - throw ngError(18, 'Multiple directives [{0}, {1}] asking for {2} on: {3}', |
| 1127 | + throw $compileMinErr('multidir', 'Multiple directives [{0}, {1}] asking for {2} on: {3}', |
1127 | 1128 | previousDirective.name, directive.name, what, startingTag(element));
|
1128 | 1129 | }
|
1129 | 1130 | }
|
|
0 commit comments