aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index 34ea6b1d..03eb3acd 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -532,6 +532,19 @@ describe("widget", function(){
// we need to have real events on the scopes.
expect(element.text()).toEqual('4');
});
+
+ it('should evaluate onload expression when a partial is loaded', function() {
+ var element = jqLite('<ng:include src="url" onload="loaded = true"></ng:include>');
+ var scope = angular.compile(element);
+
+ expect(scope.loaded).not.toBeDefined();
+
+ scope.url = 'myUrl';
+ scope.$inject('$xhr.cache').data.myUrl = {value:'my partial'};
+ scope.$init();
+ expect(element.text()).toEqual('my partial');
+ expect(scope.loaded).toBe(true);
+ });
});
describe('a', function() {
ref='#n122'>122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154