Javascript 在AngularJS模块内运行初始化解析函数
我已经读到初始化解析的一个好方法是在创建模块时。我编写了以下代码,但是当我运行程序时,Parse似乎没有初始化。我是否缺少在模块上设置运行函数的基本知识 代码如下:Javascript 在AngularJS模块内运行初始化解析函数,javascript,angularjs,parse-platform,angularjs-module,Javascript,Angularjs,Parse Platform,Angularjs Module,我已经读到初始化解析的一个好方法是在创建模块时。我编写了以下代码,但是当我运行程序时,Parse似乎没有初始化。我是否缺少在模块上设置运行函数的基本知识 代码如下: var myApp = angular.module('myApp', []); myApp.config(function ($routeProvider, $locationProvider) { }) .run(function($rootScope) { Parse.initialize("
var myApp = angular.module('myApp', []);
myApp.config(function ($routeProvider, $locationProvider) {
})
.run(function($rootScope) {
Parse.initialize("myKey", "myKey");
$rootScope.sessionUser = Parse.User.current();
});
您是否在html中包含解析脚本?如果是,在你的angular应用程序之前?parsecdn.com/js/parse-1.2.9.min.js>是。我的头中有解析脚本,模块在主体中。