Angularjs Project -1
M2-R5.1 · Chapter 6: JavaScript and Angular JS · 1 min read
Theme Changer Through angular js
Create
Source Code -
<!DOCTYPE html>
<html ng-app="">
<head>
<title>Color Changer</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
</head>
<body bgcolor="{{ (choice=='Black') ? 'black' : 'white' }}"
text="{{ (choice=='Black') ? 'white' : 'black' }}">
Themes:
Light <input type="radio" name="c" value="white" ng-model="choice">
Dark <input type="radio" name="c" value="Black" ng-model="choice">
<br><br>
<H1 align="center">Welcome to my Website</H1>
<p align="center">This simple dummy Website </p>
</body>
</html>