-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can-view-callbacks should work with a changing can-globals document. #102
Comments
Ok, so what I think you are saying is that when a component gets defined and registered with I think we should detect this and skip auto-mounting. We probably need to setup a listener for when the document changes and then try to auto-mount again. cc @matthewp would this idea cause an problems with done-ssr? |
As a workaround, you should be able to |
index.mjs import { Component, route } from './core.mjs';
/*
Styling:
<style>@import url(/style.css);</style>
<link href="yourcss2.css" rel="stylesheet" type="text/css">
*/
export default Component.extend({
tag: 'my-app',
view: `<h1>CanApp Demo-</h1>
{{#if pageComponentPromise.isPending}}
Loading ...
{{/if}}
{{#if pageComponentPromise.isResolved}}
{{pageComponentPromise.value}}
{{# eq(routeData.page, "hello-world")}}
<a href="{{routeUrl(page='goodbye-moon')}}">Goodbye</a>
{{ else }}
<a href="{{routeUrl(page='hello-world')}}">Hello</a>
{{/ eq}}
{{/if}}`,
ViewModel: {
routeData: {
default() {
/*
route.register('{page}',{page: 'hello-world'});
route.data = new DefineMap();
route.start();
*/
//return route.data;
return { page: 'hello-world' };
}
},
get pageComponentPromise(){
let name = this.routeData.page;
//return import('./'+name+'.js')
return import('./components/'+name)
.then(module => new module.default())
.then(element=>element);
}
}
}); test.mjs import myApp from './index';
const i = new myApp();
console.log(i); on node 10 current nightly do node --experimental-modules test.mjs |
works
should work
the getGlobal Function don't returns the befor registered document inside globals
The text was updated successfully, but these errors were encountered: