Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Online AngularJS Editor

<!doctype html>
<html >
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script>
  </head>
  <body>
 <html ng-app="myApp">
    <div   ng-controller="myCtrl">
        <input ng-model="FirstName" Placeholder="First Name">
        <input ng-model="LastName" placeholder="Last Name">
        Name: {{FirstName+" "+LastName}}
    </div>
        <div ng-controller="myCtrl2">
        <input ng-model="FirstName2" Placeholder="First Name">
        <input ng-model="LastName2" placeholder="Last Name">
        Name: {{FirstName2+" "+LastName2}}
    </div>
    <div ng-init="MyColor='red'" >
        <input  style="Background-color:{{MyColor}}" ng-bind="MyColor" >
    </div>
    <div ng-init="Quantity=5;Rate=2">
        Total Price:{{Quantity*Rate}}
        <br/>
        <span ng-bind="Quantity*Rate"></span>
    </div>
    <div ng-init="EmpDetails={Fname:'Anurag',LName:'Tidke'}">
        {{EmpDetails.Fname}}
    </div>
    <div ng-init="Numbers=[1,2,3,4,5,6]">
        {{Numbers[2]}}
    </div>
    <div ng-init="Names=['Anurag','Akshay','Nikhil']">
        <ul>
            <li ng-repeat="x in Names">
                {{x}}
            </li>
        </ul>
    </div>
    
    <div ng-controller="NewController">
        {{CarName}}
    </div>
    <div ng-app="NewApp" ng-controller="newController2">
        {{TestName}}
    </div>
</html>
  </body>
</html>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.FirstName= "John";
    $scope.LastName= "Doe";
});

app.controller('myCtrl2', function($scope) {
    $scope.FirstName2= "Anaya";
    $scope.LastName2= "Tidke";
});
app.controller('NewController',function($scope){
    $scope.CarName="Brezza";
});

var NewApp = angular.module('NewApp',[]);
NewApp.controller('NewController2',function($scope){
    $scope.TestName="New Test name";
    
});
</script>

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.