Tuesday, January 30, 2018

How to write a program for forms in angularJS.

  • Input controls are the HTML input elements:

  1. input elements
  2. select elements
  3. button elements
  4. textarea elements
  • We are using a button elements in this example.
  1. Bind radio buttons to your application with the ng-model directive.
  2. Radio buttons with the same ng-model can have different values, but only the selected one will be used.
<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
<body ng-app="">
Pick topic:
<input type="radio" ng-model="ABC" value="Animals">Animals
<input type="radio" ng-model="ABC" value="Cars">Cars
<input type="radio" ng-model="ABC" value="Flowers">Flowers
<div ng-switch="ABC">
<div ng-switch-when="Animals">
<h1> Animals</h1>
<p>Wlcome to world of Animals</p>
<div ng-switch-when="Cars">
<h1> Cars</h1>
<p>Wlcome to worls of Cars</p>
<div ng-switch-when="Flowers">
<h1> Flowers</h1>
<p>Wlcome to worls of Flowers</p>



Post a Comment

Thanks For Commented.