Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexfuser/421664055f937fc019fd7d544049c4fb to your computer and use it in GitHub Desktop.
Save alexfuser/421664055f937fc019fd7d544049c4fb to your computer and use it in GitHub Desktop.
Angular Setup

Angular

npm install -g @angular/cli

ng new my-new-project --style=<scss|sass|less|stylus> --routing --skip-install
ng set --global packageManager=yarn

ng g component my-new-component
ng g directive my-new-directive
ng g pipe my-new-pipe
ng g service my-new-service
ng g module my-new-module

ng serve
ng serve -H 0.0.0.0

ng build
ng build --prod
ng build --prod --aot

Angular Setup

npm install bootstrap@4.0.0-beta --save
npm install bootstrap@4.0.0-beta jquery popper.js --save
npm install font-awesome --save
npm install jquery --save
npm install @types/jquery --save-dev
npm install --save lodash
npm install --save-dev @types/lodash

package.json

"start": "ng serve -H 0.0.0.0"

.angular-cli.json

"styles": [
  "styles.styl",
  "../node_modules/bootstrap/dist/css/bootstrap.css",
  "../node_modules/font-awesome/css/font-awesome.css"
],
"scripts": [
  "../node_modules/jquery/dist/jquery.js",
  "../node_modules/popper.js/dist/umd/popper.min.js",
  "../node_modules/bootstrap/dist/js/bootstrap.min.js"
]

angular-cli with pug

npm install --save-dev gulp gulp-pug

gulpfile.js

let path = require('path');
let gulp = require('gulp');
let pug  = require('gulp-pug');

let pugFiles = './src/**/*.pug';

gulp.task('pug', () => {
  gulp.src( pugFiles )
    .pipe( pug().on('error', () => console.log('JADE ERROR')) )
    .pipe( gulp.dest('./src') );
});

gulp.task('default', ['pug'], () => {
  gulp.watch(pugFiles, ['pug']);
});

.gitignore

# HTML files
/src/**/*.html
!src/index.html

Change app.component.html to app.component.pug

gulp pug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment