MEAN project using Angular cli (commands)

  • Install the dependencies into node_modules folder.
    #npm install

Angular cli

      • Installing the Angular/cli globally
        #[sudo] npm install -g @angular/cli
      • Updating the Angular/cli globally
        #[sudo] npm uninstall -g angular-cli @angular/cli
        #npm cache clean
        #[sudo] npm install -g @angular/cli
      • Updating the Angular/cli locally #npm install –save-dev @angular/cli@latest
  • Create new angular project (using Angular cli)
    #ng new <Project name>
  • Run the project (build the source code)
    #ng serve

Use MongoDB client – mongoose

  • Install mongoose
    #npm install –save mongoose
  • Connecting to MongoDB
    #mongoose.connect(<URI>://<Host>:<Port>/<Database-name>’);
  • Setup unique package on server
    #npm install –save mongoose-unique-validator

Install Bootstrap (css framework)
#npm install –save bootstrap@3

Create new component using Angular cli
# ng generate component [Name]
OR
# ng g c NAME
# ng g c NAME –spec false (to prevent the creation of test file)