Skip to content

Instantly share code, notes, and snippets.

@tusharbabbar
Last active January 23, 2023 23:45
Show Gist options
  • Save tusharbabbar/d8fc8d3448db6085bae6 to your computer and use it in GitHub Desktop.
Save tusharbabbar/d8fc8d3448db6085bae6 to your computer and use it in GitHub Desktop.
Setting up AngularJS dev env for Ubuntu

Setting up AngularJS dev env for Ubuntu

This information is read from https://thinkster.io/learn-to-build-realtime-webapps/

Installing nodeJS and npm

Installing npm

Installing nodeJS

Setting up environment for AngularJS

###Required tools for faster development and testing in angular

  • Yoeman generator for angular js
  • GruntJS for automatic build testing
  • Bower for managing packages

Installing yoeman, grunt and bower

  • npm install -g yo
  • npm install -g generator-angular
  • npm install -g bower grunt (-g signifies global scope)

Creating your App scaffolding

This will initialize a directory with Angular development environment.

  • mkdir myApp && cd myApp
  • yo angularThe command will ask for many options.

If everything is successful then you will see Gruntfile.js, app/, bower_components/, bower.json, node_modules, test/.

In bower.json change name and moduleName. Also set the same name in app/scripts/app.js at angular.module('{name}') and in app/views/index.html at ng-app="{name}".

Working with your app

  • To add controllers/services yo angular:controller/service {controller_name}.
  • To add angular modules bower install --save {module name}. Will work only if module supports installation with bower.
  • To run your app in browser grunt serve.

For more details read this article https://thinkster.io/learn-to-build-realtime-webapps/.

@anisayari
Copy link

Yeoman* , not Yoeman :) .
http://yeoman.io

@farshidzamanirad
Copy link

Good Tut. Thanks All!

@Raziel422
Copy link

Raziel422 commented Dec 2, 2017

Good tutorial! :D also the ng-app="{name}" is insideindex.html located in in the path app/.

@RicardoKev
Copy link

Thanks... This was helpful

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