viknesb / angular1And2

App where Angular 1 and 2 app co-exists

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Angular 1 & 2 !

Simple starter example that shows you how to mix Angular 2 app with Angular 1. For the purpose of this demo, I have used John Papa's Angular 2 app and just a base Angular 1 app with different states.

##Getting Started

Before getting started make sure you have the latest version of node, bower, gulp globally installed.

  1. Clone this repo

  2. Run npm install

  3. Run the build version by command gulp serve-dev and prod version by gulp serve-prod

  4. The dev version should serve the app and watch for changes in typescript and recompile project.

Optional:

Run the TypeScript compiler and watch for changes npm run tsc

Running Node and NPM

##Notes

With the specific version of Angular 2, it is unclear as to how we can read an attribute from a component. Will need to check for future versions.

This sample intentionally uses precise versions of Angular 2 and SystemJS so new versions do not break it.

It would be ideal to use ng-Router for both Angular 1 & 2 but since it is still in development and the API is changing continuosly, I have used UI-Router for Angular 1 and ng-Router for Angular 2. So refreshing the browser when on a deep link (a named route), will get a 404 or nothing. Simply go back to the root /.

About

App where Angular 1 and 2 app co-exists


Languages

Language:JavaScript 99.2%Language:TypeScript 0.6%Language:HTML 0.2%Language:CSS 0.0%