Я продолжаю получать эту ошибку в файле client/app.js, поскольку я использую grunt для ее компиляции в производство. У меня никогда не было этой ошибки до разработки. Я не нашел четких указаний относительно того, как исправить это на стороне клиента. Я инициализирую Parse в нижней части страницы.Как вы исправите «Parse» не определен.?
Мои app.js:
'use strict';
angular.module('cpApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ui.router',
'ui.bootstrap',
'parse-angular',
'angularPayments',
'elif'
])
.config(function ($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider) {
$urlRouterProvider
.otherwise('/');
$locationProvider.html5Mode(true);
$httpProvider.interceptors.push('authInterceptor');
})
.factory('authInterceptor', function ($rootScope, $q, $cookieStore, $location) {
return {
// Add authorization token to headers
request: function (config) {
config.headers = config.headers || {};
if ($cookieStore.get('token')) {
config.headers.Authorization = 'Bearer ' + $cookieStore.get('token');
}
return config;
},
// Intercept 401s and redirect you to Landing Page
responseError: function(response) {
if(response.status === 401) {
$location.path('/');
// remove any stale tokens
$cookieStore.remove('token');
return $q.reject(response);
}
else {
return $q.reject(response);
}
}
};
})
.run(function ($rootScope, $location, Auth) {
Parse.initialize('key1', 'key2');
// Redirect to card if route requires auth and you're not logged in
$rootScope.$on('$stateChangeStart', function (event, next) {
Auth.isLoggedInAsync(function(loggedIn) {
if (next.authenticate && !loggedIn) {
$location.path('/');
}
});
});
});
Действительно? Нет никого, кто может протянуть руку кому-то, кто пытается развернуть производство в Хероку в первый раз? – rashadb