Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorials</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"> </script> </head> <body ng-app="myApp" ng-controller="styleCtrl"> <h2>ng-style Directive in AngularJS Tutorials</h2> <h1 ng-style="styleObj">Welcome to AngularJS Tutorials</h1> <script> var app = angular.module("myApp", []); app.controller("styleCtrl", function($scope) { $scope.styleObj = { "color" : "white", "background-color" : "orange", "font-size" : "40px" } }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.