aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisko Hevery2012-03-11 22:36:29 -0700
committerMisko Hevery2012-03-11 22:36:29 -0700
commitcce31d4c93978a9b2ed3bddb5f16e22fa0d07f5b (patch)
treeb4f3fc9f1fc2c3b1445256a5fa5c38f0cc812b01
parent3e5377f4f3b1d0f06af50e21026835bee0556b4a (diff)
downloadangular.js-cce31d4c93978a9b2ed3bddb5f16e22fa0d07f5b.tar.bz2
chore(ng-include): update to work in ng-include|src mode
-rw-r--r--src/directive/ngInclude.js4
-rw-r--r--test/directive/ngIncludeSpec.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/directive/ngInclude.js b/src/directive/ngInclude.js
index 297de966..90fd0b40 100644
--- a/src/directive/ngInclude.js
+++ b/src/directive/ngInclude.js
@@ -13,7 +13,7 @@
*
* @scope
*
- * @param {string} src angular expression evaluating to URL. If the source is a string constant,
+ * @param {string} ng-include|src angular expression evaluating to URL. If the source is a string constant,
* make sure you wrap it in quotes, e.g. `src="'myPartialTemplate.html'"`.
* @param {Scope=} [scope=new_child_scope] optional expression which evaluates to an
* instance of angular.module.ng.$rootScope.Scope to set the HTML fragment to.
@@ -78,7 +78,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
return {
restrict: 'EA',
compile: function(element, attr) {
- var srcExp = attr.src,
+ var srcExp = attr.ngInclude || attr.src,
scopeExp = attr.scope || '',
onloadExp = attr.onload || '',
autoScrollExp = attr.autoscroll;
diff --git a/test/directive/ngIncludeSpec.js b/test/directive/ngIncludeSpec.js
index 32d760c3..f4652a73 100644
--- a/test/directive/ngIncludeSpec.js
+++ b/test/directive/ngIncludeSpec.js
@@ -33,7 +33,7 @@ describe('ng-include', function() {
it('should remove previously included text if a falsy value is bound to src', inject(
putIntoCache('myUrl', '{{name}}'),
function($rootScope, $compile, $browser) {
- element = jqLite('<ng:include src="url" scope="childScope"></ng:include>');
+ element = jqLite('<div ng-include="url" scope="childScope"></div>');
element = $compile(element)($rootScope);
$rootScope.childScope = $rootScope.$new();
$rootScope.childScope.name = 'igor';