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

Create dynamic sitemap on ruby on rails

Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are available for crawling. In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site. It’s basically a XML file describing all URLs in your page: The following example shows a Sitemap that contains just one URL and uses all optional tags. The optional tags are in italics. <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">    <url>       <loc>http://www.example.com/</loc>       <lastmod>2005-01-01</lastmod>       <changefreq>monthly</changefreq>     ...

Omniauth Linked in Ruby On Rails

def get_linkedin_user_data      omniauth = request.env["omniauth.auth"]      dat=omniauth.extra.raw_info      linked_app_key = "xxxxxxx"      linkedin_secret_key = "yyyyyyy"      client = LinkedIn::Client.new(linked_app_key,linkedin_secret_key)      client.authorize_from_access(omniauth['credentials']['token'],omniauth['credentials']['secret'])      connections=client.connections(:fields => ["id", "first-name", "last-name","picture-url"])      uid=omniauth['uid']      token=omniauth["credentials"]["token"]      secret=omniauth["credentials"]["secret"]   #linked user data     omniauth = request.env["omniauth.auth"]      data             = omniauth.info      user_name...

Install Rvm on ubuntu

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev curl -L https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm rvm install 2.0.0-p645 rvm use 2.0.0-p645 --default ruby -v rvm gemset create rails3.2.8 rvm gemset use rails3.2.8 gem install rails -v 3.2.8