chore(ng-include): update to work in ng-include|src mode

This commit is contained in:
Misko Hevery 2012-03-11 22:36:29 -07:00
parent 3e5377f4f3
commit cce31d4c93
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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';