'use strict' in angularjs and window.x undefined but still runs the file without error
本问题已经有最佳答案,请猛点这里访问。
我正在尝试编写angularjs和javascript函数,但我对关键字
1 2 3 4 5 6 7 8 9 10 11 12 | ( function() { 'use strict'; var x ="hello"; console.log("window.x:", window.x); //undefined console.log("x:", x); //hello angular.module('myFirstApp', []) .controller('MyFirstController', function() { }); })(); |
1 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"> |