run angular Js ng-submit locally in notepad

Hi friends in this post I am sharing how to run ng-submit .Just link the angular.min.js correct and create a html file and do the procedures given below.


Copy and paste the following code in the html file,

<html ng-app="submitExample">
  <meta charset="UTF-8">
  <title>Example - example-example77-production</title>
  <script src="file:///C:/Users/TOSHIBA/Desktop/img/angular/angular.min.js"></script>
<body >
<form ng-submit="submit()" ng-controller="ExampleController">

  Enter text and hit enter:
  <input type="text" ng-model="text" name="text" />
  <input type="submit" id="submit" value="Submit" />
  angular.module('submitExample', [])
    ['$scope', function($scope){$scope.list = [];$scope.text = 'hello';$scope.submit = function()
    {if ($scope.text) { $scope.list.push(this.text); $scope.text = '';}  };}]
Most of them will not get the output, if the yellow highlighted text is not placed.So be sure to you have add this line.

Print Friendly and PDF

About me

Hi. I am interested in blogging.And sometimes play with webdesign,web development,domain sale,designing logo and more.

    Blogger Comment
    Facebook Comment


Post a Comment