Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

Upgrade to Angular 2 rc.5 #7

Closed
demisx opened this issue Aug 15, 2016 · 10 comments
Closed

Upgrade to Angular 2 rc.5 #7

demisx opened this issue Aug 15, 2016 · 10 comments

Comments

@demisx
Copy link

demisx commented Aug 15, 2016

Angular 2 RC.5 has changed a few things around introducing a bunch of breaking changes. Currently, it represents the expected public API of the 2.0 release according to the Angular dev team. Would be very helpful to have this Quickstart UI Router app upgraded to support the ngModule based rc.5 release.

@demisx demisx changed the title Upgrade to Angular rc.5 Upgrade to Angular 2 rc.5 Aug 15, 2016
@christopherthielen
Copy link
Member

Yep, I'm working on it. rc.5 introduced some breaking changes for ui-router (also totally changed how apps should be bootstrapped)

@demisx
Copy link
Author

demisx commented Aug 16, 2016

Thank you for excellent news Chris. 👍 We are refactoring our rc.4 app as well.

@kolkov
Copy link

kolkov commented Aug 16, 2016

Hi! Thank you for your work, @christopherthielen
I was started my new big project on Angular1 and ui-router one month ago, but now I'm trying to completely rewrite it on Angular2 and ui-router-ng2.
I look forward to updates!

@demisx
Copy link
Author

demisx commented Aug 22, 2016

@christopherthielen Any rough ETA on this? Don't mean to rush, just trying to get an idea for some internal planning. Thank you for all your excellent work.

@christopherthielen
Copy link
Member

Before next Friday; hopefully sooner

@reyramos
Copy link
Contributor

I've submitted a pull request with updated module to RC5, check it out

@reyramos
Copy link
Contributor

Provided a webpack example forked from this repo, thanks for the quickstart.

@christopherthielen
Copy link
Member

@reyramos thanks for PR.

There are some major changes for ui-router-ng2 bootstrap coming soon because of NgModule!

@christopherthielen
Copy link
Member

ui-router 1.0.0-beta.2 is released with NgModule support.

/**
* Define the app's root NgModule
*
* This module:
* - imports the other initial (non-lazy-loaded) application modules
* - provides the UIRouter instance
* - registers router configuration
* - enables hash urls ("#/foo")
* - provides a module lazy loading strategy (SystemJSModuleLoader)
* - registers states
* - bootstraps a ui-view
*/
@UIRouterModule({
imports: [
BrowserModule,
FooModule,
BarModule,
// BazModule will be lazy loaded
],
providers: [
// Provide the UIRouter instance to the root module
provideUIRouter({ configClass: MyUIRouterConfig, useHash: true }),
// Provide a lazy loading strategy
{provide: NgModuleFactoryLoader, useClass: SystemJsNgModuleLoader}
],
// provide the initial states
states: MAIN_STATES,
// bootstrap a UIView component
bootstrap: [UIView]
})
export class AppModule { }

Lazy loading of NgModule is now supported. See:

  • // This is the Future State for lazy loading the BazModule
    { name: 'app.baz', url: '/baz', lazyLoad: loadNgModule('src/baz/baz.module') }
  • import {UIRouterModule} from "ui-router-ng2";
    import {SharedModule} from "../.module";
    import {BAZ_STATES} from "./baz.states";
    /** The Baz NgModule. */
    @UIRouterModule({
    imports: [SharedModule],
    states: BAZ_STATES
    })
    export default class BazModule { }

@demisx
Copy link
Author

demisx commented Sep 12, 2016

Thank you so much for upgrading to the latest Angular 2 rc6!

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

No branches or pull requests

4 participants