route.data
to an observable within the AppVM
instead of the AppVM
directly.
AppVM = DefineMap.extend({
routeData: {default: ()=> new DefineMap({},false)},
init() {
route.data = this.routeData;
route.start();
},
can-route
serialize: false
index.html
should look like:<!doctype html>
<title>CanJS and StealJS</title>
<script src="./node_modules/steal/steal.js"></script>
<my-app></my-app>
<script>
tag loads steal.js. Steal will load your index.js
file (which is the main of the package.json
-> "main": "index.js",
)
(node:49131) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 46)
(node:49131) UnhandledPromiseRejectionWarning: file:/Project/Kosmos/trouper/trouper/node_modules/jquery/dist/jquery.js:906
var div = document.createElement("div");
^
TypeError: Cannot read property 'createElement' of undefined
at assert (file:/Project/Kosmos/trouper/trouper/node_modules/jquery/dist/jquery.js:906:21)
at file:/Project/Kosmos/trouper/trouper/node_modules/jquery/dist/jquery.js:2628:24
at file:/Project/Kosmos/trouper/trouper/node_modules/jquery/dist/jquery.js:2679:3
at file:/Project/Kosmos/trouper/trouper/node_modules/jquery/dist/jquery.js:34:3
at file:/Project/Kosmos/trouper/trouper/node_modules/jquery/dist/jquery.js:38:2
at Script.runInThisContext (vm.js:91:20)