This repository is a starting point to build reuseable and testable Angular 2 components.
- Angular 2.0.1
- TypeScript 2
- Type management with NPM (@types)
- Demo application that shows the component(s) in action
- webpack
- Linter's to follow the official Angular 2 Style Guide through Codelyzer
- Clone the repository
git clone https://github.com/axa-ch/ng2-component-starter.git
- Change directory to ng2-component-starter
cd ng2-component-starter
- Install global node module dependencies
npm install webpack protractor rimraf -g
- Run
npm install
to install local node-module dependencies
npm run demo
- Run demo to see sample components in action (visit http://localhost:3000)
This starter project could have some items / settings you probably want to remove or adjust. This checklist helps you to review your component needs.
- Fork repository to your own account or wherever you want
- Clone your repository locally
- Refactor README.md in
main
folder- This includes refactoring repo-clone link
- This includes refactoring gitter link and (dev)Dependency status links
- Edit package.json
- Edit different properties such as
name
,description
,repository-url
and further more
- Edit different properties such as
- Edit
demo/index.html
- Author link
- Meta description
- Edit
demo/components/clock-section.component.ts
ClockSectionComponent
src property
- Edit
demo/components/getting-started-section/getting-started-section.component.html
- iframe src
- Edit
demo/components/getting-started-section/getting-started-section.component.ts
name
property
- Implement your new component
If you would like to publish your component to the @axa-ch scope, you have to log in to this account using npm. See contact information on npmjs.
npm login
- Then enter user and password and emailnpm publish --access public
- Publishes the repo.- Consider adding your personal npmjs user as contributor to the newly published repository. So you can continue working with your personal account.
[Describe your component here. Mention dependencies to other modules/components here if neccessary.]
[Required steps to make your component ready to use]
npm install ng2-your-component --save
[Link to a location, where to see your component in action]
[How to use your component. How to get started quickly.]
ng2-your-component ships as un-bundled CommonJS modules (located in the dist folder), which can be imported with require('ng2-your-component');, or import for those environments that support this method (e.g. TypeScript 1.6+).
ng2-your-component also ships with a bundle in the system format (dist/ng2-your-component-bundle.js), suitable for use with the es6-module-loader and related loaders such as SystemJS.
[Refer to API documentation of your component. Cosider doing this in the GitHub wiki.]