Understanding controllers

As we develop the presentation layer using HTML and JavaScript, the presentation layer becomes more complex, especially when we wire up the JavaScript code with HTML elements on the page. For example, to fire an event in order to call the JavaScript function, the business logic is not directly involved with the page and implements data access layer code using an Ajax call to the data access layer code. AngularJS controllers are the fundamental entry points to the presentation layer. The controllers contain all the functions that we need to call a page. We can call an AngularJS controller in the DOM using the ng-controller directive, which is much simpler than calling the traditional JavaScript.

In order to create an AngularJS ...

Get Mastering AngularJS for .NET Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.