Creating Toggle Button for AngularJS
for more examples about AngularJS
A Pen by mehmetcanker on CodePen.
| <html ng-app="mehmetCanker"> | |
| <head> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js"></script> | |
| </script> | |
| </head> | |
| <body> | |
| <div ng-controller="ngShowExample"> | |
| <button ng-model="status" ng-init="status=false" ng-click="status=!status">Toggle Button</button> | |
| <p ng-show="status">Showed</p> | |
| <p> {{' Status: ' + status }}</p> | |
| </div> | |
| </body> | |
| </html> |
| //More info htpp://mehmetcanker.com | |
| //Module Defining | |
| //Module Tanimlaniyor. | |
| var myApp = angular.module('mehmetCanker', []); | |
| //Creating Controller in mehmetCanker module | |
| //Olusturulan module icine controller //tanimladik | |
| myApp.controller('ngShowExample', ['$scope', function($scope){ | |
| //NO CONTROLLER Logic Required | |
| }]); |
| /* | |
| ---AngularJS Toggle Button--- | |
| For More Examples AngularJS | |
| http://mehmetcanker.com | |
| */ |