aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2012-03-08 15:42:35 -0800
committerIgor Minar2012-03-08 22:29:35 -0800
commit5d09a1efd3ff98fc2fbba2f8f64230704f4a5e96 (patch)
treea978ec1d082ee4e34a01090665f5ae59dc17377f /test
parentf54db2ccda399f2677e4ca7588018cb31545a2b4 (diff)
downloadangular.js-5d09a1efd3ff98fc2fbba2f8f64230704f4a5e96.tar.bz2
fix(ng-view, ng-include): onload and $contentLoaded
- change custom onload directive to special arguments recongnized by both ng-view and ng-include - rename $contentLoaded event to $viewContentLoaded and $includeContentLoaded - add event docs
Diffstat (limited to 'test')
-rw-r--r--test/directive/ngIncludeSpec.js8
-rw-r--r--test/directive/ngViewSpec.js4
2 files changed, 6 insertions, 6 deletions
diff --git a/test/directive/ngIncludeSpec.js b/test/directive/ngIncludeSpec.js
index 79215096..dc761abc 100644
--- a/test/directive/ngIncludeSpec.js
+++ b/test/directive/ngIncludeSpec.js
@@ -64,14 +64,14 @@ describe('ng:include', function() {
}));
- it('should fire $contentLoaded event after linking the content', inject(
+ it('should fire $includeContentLoaded event after linking the content', inject(
function($rootScope, $compile, $templateCache) {
var contentLoadedSpy = jasmine.createSpy('content loaded').andCallFake(function() {
expect(element.text()).toBe('partial content');
});
$templateCache.put('url', [200, 'partial content', {}]);
- $rootScope.$on('$contentLoaded', contentLoadedSpy);
+ $rootScope.$on('$includeContentLoaded', contentLoadedSpy);
element = $compile('<ng:include src="\'url\'"></ng:include>')($rootScope);
$rootScope.$digest();
@@ -193,8 +193,8 @@ describe('ng:include', function() {
it('should compile only the content', inject(function($compile, $rootScope, $templateCache) {
// regression
- var onload = jasmine.createSpy('$contentLoaded');
- $rootScope.$on('$contentLoaded', onload);
+ var onload = jasmine.createSpy('$includeContentLoaded');
+ $rootScope.$on('$includeContentLoaded', onload);
$templateCache.put('tpl.html', [200, 'partial {{tpl}}', {}]);
element = $compile('<div><div ng:repeat="i in [1]">' +
diff --git a/test/directive/ngViewSpec.js b/test/directive/ngViewSpec.js
index d74812d3..afdded94 100644
--- a/test/directive/ngViewSpec.js
+++ b/test/directive/ngViewSpec.js
@@ -271,7 +271,7 @@ describe('ng:view', function() {
inject(function($templateCache, $rootScope, $location) {
$rootScope.$on('$beforeRouteChange', logger('$beforeRouteChange'));
$rootScope.$on('$afterRouteChange', logger('$afterRouteChange'));
- $rootScope.$on('$contentLoaded', logger('$contentLoaded'));
+ $rootScope.$on('$viewContentLoaded', logger('$viewContentLoaded'));
$templateCache.put('tpl.html', [200, '{{value}}', {}]);
$location.path('/foo');
@@ -279,7 +279,7 @@ describe('ng:view', function() {
expect(element.text()).toBe('bound-value');
expect(log).toEqual(['$beforeRouteChange', '$afterRouteChange', 'init-ctrl',
- '$contentLoaded']);
+ '$viewContentLoaded']);
});
});