Home > Articles > .Net Framework Articles > AngularJs Directives and their uses.

AngularJs Directives and their uses.

by vikash kumar   on Feb 15, 2016   Category: .Net Framework  | Level: Advance  |  Views: 492    |  Points: 100   
Like this article? Bookmark and Share:
I have come with AngularJs directives and their uses.

AngularJs is nothing more it’s just a new JavaScript framework to develop single page application.

It consists of three main parts.

1. ng-app: - It is a directive which defines AngularJs application.

2. ng-model: - It is also a directive which binds AngularJs application data to the HTML input controls.

3. ng-bind: - It is also a directive which binds AngularJs application data to HTML tags.

4.  ng-repeat: - This directive repeats html elements for each item in a collection.

See example of each directive :-



<body ng-app="">
    <form id="form1" runat="server">


        <table>
            <tr>
                <td>Name :
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" ng-model="name"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">Name is <span ng-bind="name"></span>
                </td>
            </tr>
        </table>

    </form>
</body>
 
type any name in textbox and see the result below the textbox.

Note: - See attachment for step by step working.
 


Like this article? Bookmark and Share:

Most viewed Articles

User Comments


No response found, be the first to review this article.

Submit feedback about this article

Please sign in to post feedback

Latest Posts