aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index 606491a9..d4d0e43a 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -4,7 +4,6 @@ describe("widget", function(){
beforeEach(function() {
scope = null;
element = null;
- var compiler = new Compiler(angularTextMarkup, angularAttrMarkup, angularDirective, angularWidget);
compile = function(html, parent) {
if (parent) {
parent.html(html);
@@ -12,8 +11,7 @@ describe("widget", function(){
} else {
element = jqLite(html);
}
- scope = compiler.compile(element)(element);
- return scope;
+ return scope = angular.compile(element)().scope;
};
});
@@ -594,7 +592,7 @@ describe("widget", function(){
});
it('should call change on switch', function(){
- var scope = angular.compile('<ng:switch on="url" change="name=\'works\'"><div ng:switch-when="a">{{name}}</div></ng:switch>');
+ var scope = angular.compile('<ng:switch on="url" change="name=\'works\'"><div ng:switch-when="a">{{name}}</div></ng:switch>')().scope;
scope.url = 'a';
scope.$eval();
expect(scope.name).toEqual(undefined);
@@ -606,7 +604,7 @@ describe("widget", function(){
describe('ng:include', function(){
it('should include on external file', function() {
var element = jqLite('<ng:include src="url" scope="childScope"></ng:include>');
- var scope = angular.compile(element);
+ var scope = angular.compile(element)().scope;
scope.childScope = createScope();
scope.childScope.name = 'misko';
scope.url = 'myUrl';
@@ -619,7 +617,7 @@ describe("widget", function(){
it('should remove previously included text if a falsy value is bound to src', function() {
var element = jqLite('<ng:include src="url" scope="childScope"></ng:include>');
- var scope = angular.compile(element);
+ var scope = angular.compile(element)().scope;
scope.childScope = createScope();
scope.childScope.name = 'igor';
scope.url = 'myUrl';
@@ -638,7 +636,7 @@ describe("widget", function(){
it('should allow this for scope', function(){
var element = jqLite('<ng:include src="url" scope="this"></ng:include>');
- var scope = angular.compile(element);
+ var scope = angular.compile(element)().scope;
scope.url = 'myUrl';
scope.$service('$xhr.cache').data.myUrl = {value:'{{c=c+1}}'};
scope.$eval();
@@ -652,7 +650,7 @@ describe("widget", function(){
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);
+ var scope = angular.compile(element)().scope;
expect(scope.loaded).not.toBeDefined();
@@ -791,7 +789,7 @@ describe("widget", function(){
var rootScope, rootScope, $route, $location, $browser;
beforeEach(function() {
- rootScope = angular.compile('<ng:view></ng:view>');
+ rootScope = angular.compile('<ng:view></ng:view>')().scope;
$route = rootScope.$service('$route');
$location = rootScope.$service('$location');
$browser = rootScope.$service('$browser');
@@ -870,7 +868,7 @@ describe("widget", function(){
rootScope = angular.compile(
'<div>' +
'include: <ng:include src="\'includePartial.html\'">' +
- '</ng:include></div>', myApp);
+ '</ng:include></div>')(myApp).scope;
$browser.xhr.expectGET('viewPartial.html').respond('content');
$browser.xhr.flush();