A complete, yet simple, starter for Angular 2 using TypeScript.
This seed repo serves as an Angular 2 starter for anyone looking to get up and running with Angular 2 and TypeScript fast. Using Webpack 2 for building our files and assisting with boilerplate.
- TS
- CSS
- Sass support with Libsass for super fast compiles.
- Autoprefixer adds vendor prefixes to CSS rules by Can I use database.
- CSSNext to use tomorrow’s CSS syntax, today.
- PostCSS Assets - An asset manager for CSS.
- PostCSS Focus - Add
:focus
selector to every:hover
for keyboard accessibility. - CSS linting with stylelint, doiuse and colorguard.
- Sourcemaps for global CSS.
- Development mode
- Fast TS re-bundling.
- File Watching and page reloading.
- Production builds
- TS and CSS minification.
- Cache busting.
- Local sever for testing production build.
# clone our repo
$ git clone https://github.com/codewareio/angular2-ts-seed.git my-app
# change directory to your app
$ cd my-app
# install the dependencies with npm
$ npm i
# start mock json api
$ npm run start:mock-api
# start webpack-dev-server in a separate terminal session
$ npm start
navigate to http://localhost:3000 or http://0.0.0.0:3000 in your browser.
- Getting Started
- Other commands
- Frequently asked questions
What you need to run this app:
node
andnpm
(use NVM)- Ensure you're running Node (
v4.1.x
+) and NPM (2.14.x
+)
fork
this repoclone
your forknpm i
to install all dependenciesnpm run start:mock-api
to start mock json apinpm start
to start webpack-dev-server- navigate to http://localhost:3000
After you have installed all dependencies you can now run the app. Run npm start
to start a local server using
webpack-dev-server
which will watch, build (in-memory), and reload for you. The port will be displayed to you
as http://0.0.0.0:3000
(or if you prefer IPv6, if you're using express server, then it's http://[::1]:3000
).
Please note, not all commands will be listed here, feel free to check out the npm scripts section in package.json
.
# production build
$ npm run build
# serve it, on port 8080
$ npm run start:prod
$ npm start
# or
$ npm run start:dev
# run js lint
$ npm run lint:ts
# run scss lint
$ npm run lint:scss
generate scaffold files with plop
You can generate component, directive, pipe, service, route, action -, reducer -, selector-, effect for ngrx.
$ npm run generate
- What's the current browser support for Angular 2 Beta?
- Please view the updated list of browser support for Angular 2
- How do I start the app when I get
EACCES
andEADDRINUSE
errors?- The
EADDRINUSE
error means the port3000
is currently being used andEACCES
is lack of permission for webpack to build files to./dist/
- The
- What are the naming conventions for Angular 2?
- Some dependencies are not met, what's going on?
es6-shim
andreflect-metadata
are dependencies of angular 2. We decided to includecore-js
as a better replacement.
- What is the
.github
folder for?- Read more about it here: Issue and Pull Request templates. Long story short, it is not a vital part of the project. Feel free to delete it.