gokemon / angular-router

Angular 2 Component Router sample demo I've creating to share ~ still in process

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angular-router

angular2 routing sample demo I've creating to share

This project came from the Angular 2 Routing page in my tuts-plus repo.

https://angular.io/docs/ts/latest/tutorial/

I am trying to better understanding routing in ng2 with components, rather than the old way we did it in Angular 1x world.

Ok, so I had the components spread out among folders for hero, hero-details, dashboard, etc... and it was getting to messy and I need to get through the routing part. So I moved everything back to the app-root, and reset the path in the files. DONE

Next steps... move the files slowly back out to component folders, OR just learn how to use the CLI to create these in the first place.

  • Added the Angular router to navigate among different components.
  • Learned how to create router links to represent navigation menu items.
  • Used router link parameters to navigate to the details of the user-selected hero.
  • Shared the HeroService among multiple components.
  • Moved HTML and CSS out of the component file and into their own files.
  • Added the uppercase pipe to format data.

So one more step is the remote data access.

  • Replace the mock data with data retrieved from a server using http.
  • "the HTTP client will fetch and save data from a mock service, the in-memory web API".
  • Recreate this whole project with CLI, using routes and components in the first place.

One second thought, I might also go check out the thinkster site that matches several different front-ends with several different back-ends via a common API.

All in all not a bad day. Mind straining as the tutorial style was not helpful.

About

Angular 2 Component Router sample demo I've creating to share ~ still in process

License:MIT License


Languages

Language:TypeScript 33.9%Language:CSS 32.7%Language:JavaScript 22.6%Language:HTML 10.8%