Skip to main content

Posts

Showing posts from April, 2018

Add 'Night mode' using AngularJS

Night mode is said to decrease the light intensity and cause less stress to viewer's eyes. Adding night mode to your websites and blogs would be beneficial to your viewers who prefer reading at night. Although most of the users generally have a browser add-on, adding this small feature won't do you any harm. Also, if you are a web developer, you can integrate this with your project. Night mode is usually turning a white page black and black font white. Other changes can also be added easily in AngularJS. This post assumes that you have basic knowledge about AngularJS. Follow the steps: 1. Import AngularJS script into your project. <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> 2 . Add ng-app and ng-controller to your <HTML> tag. <html ng-app="" ng-controller="myCtrl"> 3 . Add ng-style to your body or any particular div where you want to see the effect. <div