Bootstraping of Angular4 with AdminLTE dashboard template ( Using ngx-admin-lte Library)
This version use the new npm package ngx-admin-lte (this will be easier to update) If your are looking for the old version for angular check the "angular2" branch.
There's now two different repo: bootstraping-ngx-admin-lte For those who want the full bootstraping ngx-admin-lte For whom want to install via npm in a existing project
Hey dude! Help me out for a couple of 🍻!
./bin/start.sh
./bin/prod.sh
npm install -g yarn
yarn
yarn start
Adding a component
cd src/app/widgets/
npm run gen component my-new-widget
Ajouter une page
cd src/app/pages/
yarn gen component my-new-page
Ajouter un service
cd src/app/services/
yarn gen service my-new-service
This service is used to send/get the current user informations accross the app
For example you can set the current user :
import {User} from "../../models/user";
import {UserService} from "../../services/user.service";
...
constructor(
private _user_serv: UserService
){
...
ngOnInit(){
let user = new User({
firstname: "WEBER",
lastname: "Antoine",
email: "why-not-yop@yopmail.com",
avatar_url: "assets/img/user2-160x160.jpg"
});
this._user_serv.setCurrentUser( user );
and you can get the user in a widget:
import {User} from "../../models/user";
import {UserService} from "../../services/user.service";
...
private current_user: User;
constructor(
private _user_serv : UserService,
){
//se connecter au modification du user courant
this._user_serv.current_user.subscribe((user: User) => this.current_user = user);
warning, the import path are relative to the component you're writing in ...