First time creating and deploying angular2 app
These instructions teach you how to create and deploy angular2 using Firebase and Angular2 CLI
Prerequisites
What things you need to install the software and how to install them
- nodejs
- npm
- git
- angular2 CLI
A step by step download and install this links
cause you install git and node js, your computer know nom command
write following line to cmd: npm install angular-cli -g (angular2 CLI)
Create app:
$ ng new my-app
Enter app directory:
$ cd my-app
Run app:
$ ng serve
goto [http://localhost:4200] and see if app works.
build app for deploy:
$ ng build --prod
goto firebase and create a new Firebase project.
install firebase tools:
$ npm install -g firebase-tools
deploy to firebase:
$ firebase login
after authentication, run:
$ firebase init
Next the question is ask if this app is a single page app and if it should rewrite all URLs to index.html. In our case we need to answer yes.
Last question is if Firebase should over write file index.html. The answer to that question is no.
now run:
$ firebase deploy