0
require([
'common',
// Libs
'jquery',
'parse',
'i18n',
// Modules
'modules/login/controllers/login',
'modules/page/controllers/page',
// Styles
'css!../assets/css/bootstrap.min.css',
'css!../assets/css/tablesorter-bootstrap-theme.css',
'css!../assets/css/common.css',
],
function(common, $, Parse, i18n, Login, Page) {
// Defining the application router, you can attach sub routers here.
var Router = Parse.Router.extend({
routes : {
'' : 'index'
},
index : function() {
var currentUser = Parse.User.current(),
view, container;
// Load either login screen or navigation bar,
// depending on the login state of current user.
if(currentUser){
view = new Page.Views.Navbar();
container = '#navbar';
} else {
view = new Login.Views.Login();
container = '#main';
$('#navbar').html(null); // Remove the navbar
}
view.render(function(el) {
$(container).html(el);
});
}
});
$(function() {
// Initialize internationalization
i18n.init({
saveMissing: true,
debug: true,
//preload: ['dk', 'en'],
getAsync: false
});
Parse.initialize('****','****');
// Initialize the Router
var router = new Router();
Parse.history.start({ pushState: false });
});
$(document).on('click', 'a:not([data-bypass])', function(evt) {
// Get the anchor href and protcol
var href = $(this).attr('href');
var protocol = this.protocol + '//';
if (href && href.slice(0, protocol.length) !== protocol && href.indexOf('javascript:') !== 0) {
evt.preventDefault();
Parse.history.navigate(href, { trigger: true });
}
});
});
ガットエラー文字列でなければなりません:てAssertionError:パスが
assert.js:85 throw new assert.AssertionError({ ^ AssertionError: path must be a string at Module.require (module.js:482:3) at require (internal/module.js:20:19) at Object. (/home/historiejagt.portaplay.dk/public_html/app/app.js:4:1) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.runMain (module.js:590:10) at run (bootstrap_node.js:394:7)
このエコシステムは自滅しています。それは複雑さを考案したものです。 – grantwparks