mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
refactor(scenario): fix scenario bootstrap & publish injector for inspection
This commit is contained in:
parent
7cb03c5ab9
commit
4b35a59c6a
3 changed files with 12 additions and 6 deletions
|
|
@ -81,8 +81,9 @@ angular.scenario.dsl('clearCookies', function() {
|
|||
*/
|
||||
return function() {
|
||||
this.addFutureAction('clear all cookies', function($window, $document, done) {
|
||||
var rootScope = $window.angular.element($document[0]).data('$scope'),
|
||||
$cookies = rootScope.$service('$cookies'),
|
||||
var element = $window.angular.element($document[0]),
|
||||
rootScope = element.scope(),
|
||||
$cookies = element.data('$injector')('$cookies'),
|
||||
cookieName;
|
||||
|
||||
rootScope.$apply(function() {
|
||||
|
|
|
|||
|
|
@ -956,7 +956,9 @@ function angularInit(config, document){
|
|||
});
|
||||
createInjector(modules, angularModule)(['$rootScope', '$compile', '$injector', function(scope, compile, injector){
|
||||
scope.$apply(function(){
|
||||
compile(isString(autobind) ? document.getElementById(autobind) : document)(scope);
|
||||
var element = jqLite(isString(autobind) ? document.getElementById(autobind) : document);
|
||||
element.data('$injector', injector);
|
||||
compile(element)(scope);
|
||||
});
|
||||
}]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,8 +90,11 @@ angular.scenario.Application.prototype.executeAction = function(action) {
|
|||
if (!$window.angular) {
|
||||
return action.call(this, $window, _jQuery($window.document));
|
||||
}
|
||||
var $browser = $window.angular.service.$browser();
|
||||
$browser.notifyWhenNoOutstandingRequests(function() {
|
||||
action.call(self, $window, _jQuery($window.document));
|
||||
var element = $window.angular.element($window.document.body);
|
||||
var $injector = element.inheritedData('$injector');
|
||||
$injector(function($browser){
|
||||
$browser.notifyWhenNoOutstandingRequests(function() {
|
||||
action.call(self, $window, _jQuery($window.document));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue