Coder Social home page Coder Social logo

Comments (4)

trumbitta avatar trumbitta commented on April 19, 2024 3

It started working once I tried the AngularJS version of transition hooks, that is passing $transition$ instead of transition.

So:

  • Hybrid AngularJS - Angular routing via ng1-to-ng2
  • Angular state definition, with Typescript all over the place and an Angular component as the entryComponent
  • But I must use the AngularJS version of the transition hook

Puzzling, but leaving it here in case someone else finds it useful.

from angular-hybrid.

Remco75 avatar Remco75 commented on April 19, 2024

thnx, this is a weird one indeed! There should be a way to inject deps another way

from angular-hybrid.

wawyed avatar wawyed commented on April 19, 2024

When running an hybrid angular application (with uirouter hybrid) your state defininitions are actually NgHybridStateDeclaration not Ng2StateDeclaration when trying to define them in Angular, that's what might have given you the confustion about how to define the transition hooks.

from angular-hybrid.

Remco75 avatar Remco75 commented on April 19, 2024

hmm, thats true indeed,, thnx.
Found one other minor issue: the docs seem to be wrong:
https://github.com/ui-router/angular-hybrid#onenterexitretain states that the onEnter function should be injected like this:
ng2StateOnEnter.$inject = [Transition, 'MyService'];

that does not work for me, it needs to be
ng2StateOnEnter.$inject = ['$transition$', 'MyService'];

or am I missing something else @wawyed ?

from angular-hybrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.