pbastowski / angular2-now

Angular 2 @Component syntax for Angular 1 apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Abstract state bug

rvboris opened this issue · comments

Strange bug when i creating abstract state not from bootstrap function, template is not showing, if i add templateUrl to @State it's work, but scope vars is broken

Example http://plnkr.co/edit/74WX9lcXLOVSpEiG4wwU?p=preview

Could you provide more detail. Which JS file are you referring to and what line number? What have you changed in the code and/or template? etc
Then I can help you :)

OK, I just saw your new files.

Any reason you are using an abstract state in testwrap?

Abstract states are normally used for setting up globals, configuring stuff, etc. Not normally used for displaying components. If I remove abstract:true from your code then the templates do display. Is this what you were after?

I using abstract state for display page layout, like header, footer etc and setup some globals. You propose on each page to create the same components?

I'm not proposing anything like that. I'm just saying that your use of on abstract state may not be appropriate for what you want to achieve.

Have a look at the link below and let me know if this is the result you are after:

http://plnkr.co/edit/aTuyJsmb1pG10MVmmP9n?p=preview

Yes this is exactly what i need!
I never seen xabstract param before

xbstract does not exist :) I use x sometimes to "comment out" a parameter temporarily when I don't want it there.

Here is a version with out the xabstract parameter: http://plnkr.co/edit/aTuyJsmb1pG10MVmmP9n?p=preview

:) But now i have direct access to testwrap without child state (it can be empty page with header/footer)

Yeah. That looks like a missing feature. I will look into it again later today.

I have fixed the angular2-now.js file in the plunker and it now works as expected with your "testwrap" as an abstract state. This means that "testwrap" will provide a template for it's child state "test", but can not itself be activated directly.

http://plnkr.co/edit/aTuyJsmb1pG10MVmmP9n?p=preview

I will do some more testing and when I'm satisfied that it's good I'll push it to github.

working as I expected, thanks

OK, I'm closing this then.