-
JS Fatigue
-
A lot of year ago : <script src="https://code.jquery.com/jquery-1.11.3.js"></script> http://www.commitstrip.com/fr/2016/05/10/a-moment-of-nostalgia/
-
3 years ago : GruntJs
-
2 years ago : GulpJS
-
1 year ago : Webpack & JSPM
I just want to code !?!
In a project I work on now :
- 2419 LOC for the APP
- 303 LOC for the build part
Thanks the Ember team :D
- Create a global folder structure to help you start project
- Generate assets and elements at the right place (CSS(or SASS, SCSS, LESS) | HTML | TS | SPEC)
- Write skeleton of my test
- Run my test at each modification / build
- Help me with my E2E test
- Create a project
->
ng new angular2-cli-demo --style=scss
- Edit it -> Change the Hello world -> Hello AngularToulouse
- Publish it on github
->
ng github-pages:deploy --message "Deploy with CLI !"
- Create a component
->
ng generate component shared/custom
- Show the evolution of
app.module.ts
- Use the
<app-custom></app-custom>
in theapp.component.html
and show it - Remove the
<app-custom></app-custom>
from html - Add a service with
ng g service shared/time --flat false
- Serve a date from the service with
getNow(): string { return new Date().toString(); }
- Inject the service inside the constructor of the
app.component.ts
- Go back to CLI to show the warning message
- Import the service into the
app.module.ts
- with
import {TimeService} from './shared/time/time.service';
- with
providers: [TimeService],
- with
- Change the value
title
inside thengOnInit
to become
ngOnInit(): void {
this.title = this.timeService.getNow();
}
- I want a specific format, and handle more type of date... so install moment
- with
npm i -S moment
- with
- Import moment in the
TimeService
:- with
import * as moment from 'moment';
- with
- Change the return of the method
getNow
by :return moment().format('MMMM Do YYYY, h:mm:ss a');
- Simple with only behavior, I want now the material design element
- Go to the
https://github.com/angular/material2/blob/master/GETTING_STARTED.md
- install withnpm install --save @angular2-material/core @angular2-material/button @angular2-material/card
- Import into
app.module.ts
: - withimport { MdButtonModule } from '@angular2-material/button';
- withimport { MdCardModule } from '@angular2-material/card';
- andimports: [BrowserModule, FormsModule, HttpModule, MdButtonModule.forRoot(), MdCardModule.forRoot()],
- Change the file
app.component.html
<div class="container"> <md-card> <md-card-subtitle>Fantastique carte</md-card-subtitle> <md-card-title>La date du jour !</md-card-title> <md-card-content> <p>{{ title }}</p> </md-card-content> </md-card> </div>
- Add some scss to the file
app.component.scss
.container { width: 400px }
- Add the AngularToulouse logo in
src/assets/
and add to the template -> - Publish it on github again
->
ng github-pages:deploy --message "Deploy with CLI the result of demo !"
- It can auto-complete your command line
- Like Google Cloud (gcloud) or Git
ng doc
to check information about anything in angular- Where is all my config... In the angular-cli.json (https://github.com/angular/angular-cli/blob/88c77d69275da9328b432c20b836364036792744/docs/design/ngConfig.md)
- Upgrading against the style-guide
- Support for Javascript, Dart and/or maybe more ?
- Create its own
Template
(blue-print) - Deploy on docker, or everywhere ! (https://github.com/angular/angular-cli/blob/88c77d69275da9328b432c20b836364036792744/docs/design/docker-deploy.md)
- Install directly from CLI 3rd Party libs
- Hook to integrate with build system