Développement

Astuces de développement

Outils pour utilisateurs

Outils du site


langages:angular:outils:angular-cli

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
langages:angular:outils:angular-cli [2019/01/26 16:08]
jonathan créée
langages:angular:outils:angular-cli [2020/11/18 20:29] (Version actuelle)
jonathan
Ligne 12: Ligne 12:
  
 ===== Générer un projet ===== ===== Générer un projet =====
 +
 +==== Projet Solo ====
 +
 +[[https://angular.io/cli/new]]
 <code> <code>
-ng new project-name --routing=true --skipTests=true+ng new project-name --routing=true --skipTests=true --style=scss 
 +</code> 
 + 
 +==== Projet Multi ==== 
 + 
 +  * https://octoperf.com/blog/2019/08/22/kraken-angular-workspace-multi-application-project/ 
 +  * https://angular.io/guide/file-structure 
 + 
 +<code> 
 +ng new NomDuProjet --createApplication=false --directory=nom-du-projet --interactive=false 
 +cd nom-du-projet 
 +ng generate application app1 --style=scss --routing=true --skipTests=true 
 +ng generate application app2 --style=scss --routing=true --skipTests=true 
 +ng generate lib library1 
 +ng generate c component1 --project=app2 
 + 
 +// compiler et installer la librairie au sein du projet 
 +ng build library1 
 +npm install .\dist\library1\
 </code> </code>
  
Ligne 30: Ligne 52:
 </code> </code>
  
-===== Ajouter Bootstrap 4 =====+===== Étapes suivantes =====
  
-https://github.com/valor-software/ngx-bootstrap/blob/development/docs/getting-started/ng-cli.md+[[langages:angular:outils:ngxbootstrap|]]
  
 +===== Générer un composant =====
 +==== Projet Solo ====
 <code> <code>
-npm install ngx-bootstrap bootstrap --save+ng g c MonComposant 
 +ng g c sous-dossier/MonComposant
 </code> </code>
- +==== Projet Multi ====
-Ajouter dans ''.angular-cli.json'':+
 <code> <code>
-"styles": [ +ng g c MonComposant --project=app1 
-  "../node_modules/bootstrap/dist/css/bootstrap.min.css", +ng g c sous-dossier/MonComposant --project=app2
-  "styles.css", +
-],+
 </code> </code>
 +
langages/angular/outils/angular-cli.1548515337.txt.gz · Dernière modification: 2019/01/26 16:08 de jonathan