Skip to main content

Anjular Js Examples

Anjular Js Examples:


<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body>
<!-- <span ng-app="">
<input type="text" ng-model="test">
{{test}}
</span> -->
<!-- <span ng-app="">
<input type="text" ng-model="koti">
<span ng-bind="koti"></span>
</span> -->


<!-- <div ng-app="" ng-init="location='bangalore'">
<p>Location is :<span ng-bind="location"></span></p>

</div>

<div ng-app="">
{{50-50}}
</div> -->




===========
<!-- <div ng-app="koti"  ng-controller="raogaru">
<p>name :<span><input type="text" ng-model="name" id="check"></span></p>
<p>location :<span><input type="text"  ng-model="loc"></span></p>   
fullname {{name+""+loc}}                           
</div>
<span id="checkto">Test </span> -->

<script>
// $('#check').click(function()
// {
    //alert("sam");
// var a = angular.module('koti',[]);
// a.controller('raogaru',function($scope)
// {
// $scope.name='kotesh';
// $scope.loc='rao';
// $('#check').click(function()
//  {
//     alert($(this).val());
//     });
// });
// // });

</script>


<!--
<div ng-app="" ng-init="x=3;y=56;z=99">
{{x+y-z}}
<span ng-bind="x+y"> </span>
</div>
 -->

<!--  <div ng-app="" ng-init="first='koti';last='rao'">

 <span ng-bind="first+last"></span>
 </div>
 -->
<!-- <div ng-app="" ng-init="sam={add:'bangalore',loc:'karnataka'}">
<span ng-bind='sam.add+sam.loc'></span>
</div> -->

<!-- <div ng-app="" ng-init="x=['koti','sam','anju']">

<span ng-bind="x[1]">

</div> -->

<!-- <div ng-app="" ng-init="sam='koti'">
<input type="textarea" ng-model="sam">
<span>{{sam}} </span>
</div> -->
<!-- <div ng-app="" ng-init="k=['sam','swati']">
<span ng-repeat="z in k">
{{z}}
</span>

</div> -->

<!-- <div ng-app="" ng-init="names=[{name:'koti',loc:'bng'},{name:'sam',loc:'mlg'}]">
<span ng-repeat="k in names">
{{k.name+','+k.loc}}
</div> -->



<!-- <div ng-app="testapp" ng-controller="sample">
<input type="text" ng-model="name">
<input type="text" ng-model="loc">
{{name+','+loc}}
</div>
 -->
<script>
// var my = angular.module('testapp',[]);
// my.controller('sample',function($scope){

// $scope.name = "koti";
// $scope.loc = "rao"
// });

</script>
<!-- <div ng-app="sample" ng-controller="testing">
<input type="text" ng-model="firstname">
<input type="text" ng-model="lastname">

{{full_name()}}
</div> -->

<script>
// var m = angular.module('sample',[])
// m.controller('testing',function($scope)
// {
// $scope.firstname = "koti";
// $scope.lastname ="raogaru";
// $scope.full_name = function()
// {
//     return $scope.firstname+","+$scope.lastname
// }

// });

</script>
<!-- <div ng-app="myapp" ng-controller="koti">
<input type="number" ng-model="pric">
<input type="number" ng-model="cost">
{{(pric*cost)| currency}}
</div>
 -->
<script>
// var a = angular.module('myapp',[]).controller('koti',function($scope)
// {
// $scope.pric= 12;
// $scope.cost =13;

// })

</script>

<!-- <div ng-app="" >
<input type="textarea" ng-model="name">
{{name | lowercase | uppercase | currency}}
</div> -->


<!-- <div ng-app>
<input type="text" ng-model="test">
{{test}}
</div> -->

<!-- <div ng-app="" ng-init="sample=['3','2','1']">

<span ng-bind="sample"></span>
<span ng-repeat="s in sample || filter:s |orderby:s">
{{s}}
</span>
</div> -->


<!-- <div ng-app="samantha" ng-controller="sample">
<span ng-repeat='x in names'>
{{ x.Name + ', ' + x.Country }}
</span>
</div> -->
<script>
// angular.module('samantha',[]).controller("sample",function($scope,$http)
// {
// $http.get("http://www.w3schools.com/angular/customers.php").success(function(response) {$scope.names = response.records;});
// });

</script>

<!-- <div ng-app="swathi" ng-controller="anushka">
<table>
<tr ng-repeat = "x in names | orderBy : 'Country'">
  <!--  <td> {{$index+1}}</td>
    <td> {{x.Name}} </td>
    <td>{{x.Country | uppercase}} </td> -->
<!-- <td ng-if="$odd" style="background-color:#f1f1f1">{{ x.Name }}</td>
<td ng-if="$even">{{ x.Name }}</td>
<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.Country }}</td>
<td ng-if="$even">{{ x.Country }}</td>
</tr>
</table>

</div> -->
<script>
// angular.module("swathi",[]).controller("anushka",function($scope,$http)
// {
// $http.get("http://www.w3schools.com/angular/customers.php").success(function(response)
// {
//     $scope.names = response.records;

//     // body...
// })
// })
</script>

<!-- <div ng-app="" ng-init="mySwitch=true">
<button ng-disabled="mySwitch">Click Me!</button>
<input type="checkbox" ng-model="mySwitch">
{{mySwitch}}
</div> -->

<!-- <div ng-app="">
<span ng-show="true"> Iam kotesh</span>
<span ng-show="false"> hello</span>
<span ng-hide="true"> Iam kotesh</span>
<span ng-hide="false"> hello</span>
</div> -->
<!-- <div ng-app="">
<button ng-click="count=count+1">welcome kotesh</button>{{count}}
</div>
 -->

<!--  <div ng-app="koti" ng-controller="rao">
<button ng-click="togle()">Button </button>
<p ng-show="disp">
<input type="text" ng-model="firstname">
<input type="text" ng-model="lastname">
</p>
 </div> -->
 <script>
//  angular.module("koti",[]).controller("rao",function($scope)
//  {
// $scope.firstname="kotesh";
// $scope.lastname = "rao";
// $scope.disp = true;
// $scope.togle = function() {
// $scope.disp = !$scope.disp;
// }
//  });

 </script>

<!--  <div ng-app="rao" ng-controller="test">
<form novalidate>
<input type="text" ng-model="user.first">
<input type="text" ng-model="user.second">
<button ng-click="reset()">Reset</button>
</form>
 </div> -->

 <script>
 // angular.module("rao",[]).controller("test",function($scope)
 // {
 // $scope.master = {first:"kotesh",second:"rao"};
 // $scope.user = angular.copy($scope.master)   
 // });
 </script>


 <form ng-app="test" ng-controller="userform" name="myForm" novalidate>
 <p>user
 <input type="text" name="user "ng-model="user" required>
 <span style="color:red" ng-show="myForm.user.$dirty && myForm.user.$invalid">
  <span ng-show="myForm.user.$error.required">Username is required.</span>
 </p>
 <p>email
 <input type="emil" name="email" ng-model="email" required>
  <span style="color:red" ng-show="myForm.email.$dirty && myForm.email.$invalid">
  <span ng-show="myForm.email.$error.required">Email is required.</span>
  <span ng-show="myForm.email.$error.email">Invalid email address.</span>

 </p>
 <p>
 <input type="submit" ng-disabled="myForm.user.$dirty && myForm.user.$invalid ||
  myForm.email.$dirty && myForm.email.$invalid">
 </p>
 </form>
 <script>
var app = angular.module("test", []);
app.controller("userform", function($scope) {
    $scope.user = 'John Doe';
    $scope.email = 'john.doe@gmail.com';
});
</script>
</body>
</html>




Comments

Popular posts from this blog

Rails Migration Difference between Text and String

Rails Migration Difference between Text and String ? While working with Rails Migration Difference between Text and String is important to be known to every developer. Columns and their data types are finalized while deciding Table structure. This tutorial will help understand difference between String and Text column type and illustrate how to write Rails Migration implementing the same. You might want to read about database.yml files for specifying database configuration for Rails Application. 1. Concepts When String or Text data type is required?     Whenever you require your column to store information which is lengthy in size (Many characters), you need to consider String or Text data type for the column.     Both of them let you store Many(How Many - will see later) characters Difference between String and Text Considering MySQL database Feature     String     Text Length     1 to 255     ...

Error malloc(): memory corruption nginx with passenger?

Error malloc(): memory corruption nginx with passenger Passenger issue resolving steps :  sudo gem uninstall passenger(uninstall all passenger) sudo gem install passenger sudo passenger-install-nginx-module --auto --auto-download --prefix=/opt/nginx --extra-configure-flags=none Update nginx config file with new passenger version and restart the nginx

rake db migrate with down, up, redo, rollback options in rails

rake db migrate with down, up, redo, rollback options ? rake db migrate - This can be used to migrate your production/test database using various options like up, down, step, redo, version etc. In this tutorial we will learn how all these options can be used with rake tool to migrate the database. What is rake? rake is basically ruby make. i.e. make tool for ruby It has similar functionality to the make tool that you may have used on unix based systems for comopiling running some kind of script. rake allows you to ruby particular task in the environment that you specify. How to Install rake? You can install rake by installing gem 'rake' as, gem install rake Above command will install the latest version of rake tool avaialable. Various rake db migrate commands Operation     Command     Description General     rake db:migrate     This will migrate your database by running migrations that are not run yet Running specific Migra...