Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Sample application of angularJS

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 535
    Comment on it

    Hello guys, Here, I am writing a blog to develop application using AngularJS. AngularJs is a framework of JavaScript such as JQuery and it's very efficient. AngularJS is a cross browser independent.


    First of all, we need to add angularJS API in our html page as below :-

     <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.min.js"></script> 
    

    Now, Create model and controller as below :-

    angular.module("myapp", [])<br>
         .controller("HelloController", function($scope) {<br>
            $scope.helloTo = {};<br>
            $scope.helloTo.title = "AngularJS";<br>
         });
    

    In above, "myapp" is model of angularjs which is defined in html using "ng-app" attribute and "HelloController" is a controller of the model which is define in model of the html page.


    Now Create index.html page and put below code for your a sample angularJS application.

    <html>
    
       <head>
          <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.min.js"></script>
       </head>
    
       <body ng-app = "myapp">
    
          <div ng-controller = "HelloController" >
             <h2>Welcome {{helloTo.title}} to Findnerd!</h2>
          </div>
    
          <script>
             angular.module("myapp", [])
    
             .controller("HelloController", function($scope) {
                $scope.helloTo = {};
                $scope.helloTo.title = " Bhagwan Singh Khichar";
             });
          </script>
    
       </body>
    </html> 
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: