Book Image

Mastering AngularJS for .NET Developers

By : Mohammad Wadood Majid, Golrokh Mirzaei
Book Image

Mastering AngularJS for .NET Developers

By: Mohammad Wadood Majid, Golrokh Mirzaei

Overview of this book

<p>AngularJS is an open source framework that utilizes the Model-View-Controller architecture for client-side application development. AngularJS is referred to as the Angular framework.</p> <p>With this book, you will soon be able to build client-side data driven applications. The introduction section covers the essentials of AngularJS, covering the core concepts of AngularJS to ensure a smooth transition to the more advanced topics discussed later on.</p> <p>This book covers the development of client-side applications with AngularJS using code examples before moving on to explore how to build the ASP.NET Web API and its features using Visual Studio .NET.</p>
Table of Contents (15 chapters)
Mastering AngularJS for .NET Developers
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The first directive


In AngularJS, all the directives match the tag, element, or attributes name. The subsequent code demonstrates the varied ways in which a directive may be documented from a template. For example, myCustomDirective:

<my-custom-directive></my-custom-directive>
< !- - OR - ->
<span my-custom-directive></span>
< !- - OR - ->
<span class="my-custom-directive"></span>

Note

It is good practice to use tag names and attributes for directives instead of using elements and class names. Doing this typically makes it easier to see which directives matches a given element.

The following code example shows different options to invoke the directives:

<input type="text" ng-model=" my-Custom-Directive" placeholder="name" />
<span ng-bind=" my-Custom-Directive"></span>
<span ng:bind=" my-Custom-Directive"></span>
<span ng_bind=" my-Custom-Directive"></span>
<span x-ng-bind=" my-Custom-Directive">&lt...