ui-router / sample-app-angular-hybrid

UI-Router Hybrid Sample App: Route to Angular 1 and Angular 2 components
https://ui-router.github.io/sample-app-angular-hybrid
101 stars 63 forks source link

Example not following the documentation #297

Open QuentinLuc opened 6 years ago

QuentinLuc commented 6 years ago

At this line: https://github.com/ui-router/sample-app-angular-hybrid/blob/607c7d3dded25ea1b680e8e83290bc6a8f1f8a98/app/angularJSModule.ts#L8 There is an import to "@uirouter/angularjs" but in the documentation it's written

Remove angular-ui-router (or @uirouter/angularjs) from your AngularJS app's package.json and replace it with @uirouter/angular-hybrid. Add the @angular/* dependencies.

Therefore what should I do? If I remove it from the app's package.json, I cannot import it otherwise I got a compilation error. However, in the live example, I noticed that the @uirouter/angularjs lib has been loaded by Webpack.

I'm asking this question because I kept it in the package.json then removed it and my app doesn't run anymore (I'm using SystemJS) because I get an error in Chrome: image

Sould I keep it and reference it using some specific path (like this one: "@uirouter/angular-hybrid/node_modules/@uirouter/angularjs") which works btw?

Thanks!

k0nG commented 5 years ago

I've found changing it to import '@uirouter/angular-hybrid'; and adding @angular/router to my package.json works for me if that helps.