Skip to content
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

question: migration from ng-forward #122

Closed
david-gang opened this issue Aug 2, 2016 · 3 comments
Closed

question: migration from ng-forward #122

david-gang opened this issue Aug 2, 2016 · 3 comments

Comments

@david-gang
Copy link
Contributor

Hi,

What would I need to do to migrate from ng-forward to ng-metadata?
Is there a sort of guide line?

Thanks,
David

@aciccarello
Copy link
Collaborator

aciccarello commented Aug 2, 2016

I don't think it should be that much of a change if you are already using TypeScript. From looking at the APIs here are some things I notice.

  • Import from ng-metadata, usually ng-metadata/core, instead of ng-forward
  • the @Inject decorator is done in the constructor params instead of on the class
  • the @StateConfig decorator is not supported. Use a config block instead
  • ng-metadata uses a provide helper to define an annotated class with classic ng1 modules or you can use the bundle function
  • The Angular 2 test helpers are not yet implemented (see backport angular 2 unit testing capabilities #93)

It might be good to create a migration document in the ng-forward repo.

@david-gang
Copy link
Contributor Author

Thanks

@titonobre
Copy link

Last Friday I made de migration from ng-forward to ng-metadata and everything seems to be fine.

Another tip for those who want to migrate from ng-forward:

  • In the templates, the component scope is $ctrl, instead of ctrl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants