Intro to angular js

Home » Tutorials » JavaScript » Intro to angular js
In this lesson we will begin to learn angular javascript framework. In our time there are a lot of javascript frameworks. Now there are three major frameworks: angular js, react js and vue js
Now angular is supported by Google. React js is facebook product.

Now let’s discuss some basics of angular js. Angluar extends HTML with its own directives. Also angular makes your code compact and smaller in volume. For example, form validation with jquery and angluar are different if we will consider code volume. Jquery gives your functions and you describe validation process. Angular already has got mechanism of validation and activate it when user initializes this event. You need not to describe logics of validation.
Next feature is directives. We considered two:
ng-app – initializes angular app.
ng-model – model designation.
It is important to notice, angular uses MVC pattern (Model-View-Controller). Model in angular is data. Controller is “link” between model and view. It realizes business logics.

In this lesson we created skeleton of our future app. We used sport application, which we had written in php and mysql.
In next lessons we will continue to build it with angular.

Code lesson

<!DOCTYPE html>
<html ng-app>
    <head>
        <meta charset="utf-8">
        <title></title>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
        <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    </head>
    <body>

        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <script>
            
        </script>
        
    </body>
</html>

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Pin It on Pinterest

Share This