This repository holds the Javascript source code of the ngxjs.io quickstart, the foundation for most of the documentation samples and potentially a good starting point for your application.
This is not the perfect arrangement for your application. It is not designed for production. It exists primarily to get you started quickly with learning and prototyping in Angular
From time to time the QuickStart will add be enhanced with support for new features or to reflect changes
You can update your existing project to an up-to-date QuickStart by following these instructions:
- Create a new project using the instructions below
- Copy the code you have in your project's
main.jsfile ontosrc/app/main.jsin the new project - Copy your old
appfolder intosrc/app - Copy your old
index.htmlintosrc/ - Copy your old
styles.cssintosrc/styles/app.css - Install all your third party dependencies
- Copy over any other files you added to your project
- Copy your old
.gitfolder into your new project's root
Now you can continue working on the new project.
Node.js and npm are essential to Angular development.
Get it now if it's not already installed on your machine.Verify that you are running at least node v4.x.x and npm 3.x.x
by running node -v and npm -v in a terminal/console window.
Older versions produce errors.
We recommend nvm for managing multiple versions of node and npm.
Clone this repo into new project folder (e.g., my-project).
git clone https://github.com/angular/quickstart my-project
cd my-projectWe have no intention of updating the source on angular/quickstart.
Discard the .git folder..
rm -rf .git # OS/X (bash)
rd .git /S/Q # windowsYou could start writing code now and throw it all away when you're done. If you'd rather preserve your work under source control, consider taking the following steps.
Initialize this project as a local git repo and make the first commit:
git init
git add .
git commit -m "Initial commit"Create a remote repository for this project on the service of your choice.
Grab its address (e.g. https://github.com/<my-org>/my-project.git) and push the local repo to the remote.
git remote add origin <repo-address>
git push -u origin masterSee npm and nvm version notes above
Install the npm packages described in the package.json and verify that it works:
npm install
npm startDoesn't work in Bash for Windows which does not support servers as of January, 2017.
The npm start command first compiles the application,
then simultaneously re-compiles and runs the lite-server.
Both the compiler and the server watch for file changes.
Shut it down manually with Ctrl-C.
You're ready to write your application.
We've captured many of the most useful commands in npm scripts defined in the package.json:
npm start- runs the compiler and a server at the same time, both in "watch mode".npm run build- runs the webpack build for production.