npm install
npm install -g @angular/cli
ng new mock-app-front
cd mock-app-front
npm install jquery popper.js ajv bootstrap ngx-bootstrap ng-event-source --save
In the file ..angular-cli.json, add the following path to the array apps.styles :
../node_modules/bootstrap/dist/css/bootstrap.min.css
Open ./src/app/app.module.ts and the modules you need to "@NgModule.imports". e.g. :
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { ModalModule } from 'ngx-bootstrap/modal';
//...
@NgModule({
//...,
imports: [
//...,
BsDropdownModule.forRoot(),
TooltipModule.forRoot(),
ModalModule.forRoot()
],
//...
})
export class AppModule { }
cd mock-app-front
npm install font-awesome angular-font-awesome --save
In the file ..angular-cli.json, add the following path to the array apps.styles :
../node_modules/font-awesome/css/font-awesome.css
Open ./src/app/app.module.ts and add the following :
import { AngularFontAwesomeModule } from 'angular-font-awesome';
//...
@NgModule({
//...
imports: [
//...,
AngularFontAwesomeModule
],
//...
})
export class AppModule { }
cd mock-app-front
npm install angular-oauth2-oidc --save
Open ./src/app/app.module.ts and add the following :
import { OAuthModule } from 'angular-oauth2-oidc';
//...
@NgModule({
//...
imports: [
//...,
OAuthModule.forRoot()
],
//...
})
export class AppModule { }
cd mock-app-front
ng xi18n --locale en --outputPath src/locale
It generates the file ./src/locale/messages.xlf.
Copy messages.xlf to messages.fr.xlf. Open it, create a new node after each
cd mock-app-front
ng serve -aot --i18nFile=src/locale/messages.fr.xlf --i18nFormat=xlf --locale=fr --open
cd mock-app-front
ng generate component name-of-your-component
Then add the component in src\app\app.component.spec.ts :
...
import { NameOfYourComponentComponent } from './name-of-your-component/name-of-your-component.component';
...
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent,
...,
NameOfYourComponentComponent
],
}).compileComponents();
}));
...
cd mock-app-front
ng serve --open
cd mock-app-front
ng test