From af72f40a5512daa97c1f175a59b547c33cff1dc0 Mon Sep 17 00:00:00 2001 From: Tom Yam Date: Mon, 21 Apr 2014 15:12:38 +0300 Subject: [PATCH] fix(grunt-utils): ensure special inline CSS works when `angular` is not a global The build includes a little script to angular.js, which adds some CSS styles to the page to support things like ngCloak. This script checks that angular is not in CSP mode, but before this fix assumed that angular would be in the global scope. This commit, references `window.angular` instead of just `angular` because when running angular in an environment where the top-level scope is not the window (nodejs for example), we angular is actually a property of `window`. Closes #7176 --- lib/grunt/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index c00147fe8dac..53e026bd7fc5 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -136,7 +136,7 @@ module.exports = { .replace(/\\/g, '\\\\') .replace(/'/g, "\\'") .replace(/\r?\n/g, '\\n'); - js = "!angular.$$csp() && angular.element(document).find('head').prepend('');"; + js = "!window.angular.$$csp() && window.angular.element(document).find('head').prepend('');"; state.js.push(js); return state;