Tag Archives: controllers

Angularj, URL routing and adding a controller for beginners

Angularjs and Url routing and adding a controller for beginners

Intro

This is a quick tutorial on how to add a new controller to your angularjs application.

Just started working with Angularjs.
This is the basis of adding a new controller and wiring it into angularjs.

Awesome tutorial from angularjs. AngularJS tutorial

Summary:

tl;dr

  1. add a when to the app.js. under the $routeProvider.
  2. create the controller-weva.js file and name the controller the same as the when block.
  3. create the weva-view.html same name as in the when block to receive the controller call.
  4. add the controller-weva.js script named in the when block to the index.html
  5. visit the url from the when block.  May have to restart.

Continue reading