Prev Demo
AngularJS
>
If Condition In Angular
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> </head> <body> <div ng-app> <label><input type="checkbox" ng-model="agree" /> I agree </label> <div ng-if="agree" style="color:green;background-color:yellow">Thanks for agreeing !</div> <div ng-if="!agree" style="color:yellow;background-color:green">Please click on I agree checkbox.</div> </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output