Example of Creating Basic Factory and Service in AngularJS

[code] mainApp2.factory(‘MathService’, function() { var factory = {}; factory.multiply = function(a, b) { return a * b; }; return factory; }); mainApp2.service(‘CalcService’, function(MathServic){ this.square = function(a) { return MathService.multiply(a,a); }; }); mainApp2.controller(‘CalcController’, function($scope, CalcService) { $scope.square = function() { $scope.result = CalcService.square($scope.number); }; }); [/code] [code] <div ng-app=”mainApp2″ ng-controller=”CalcController”> <p>Enter a number: <input type=”number” ng-model=”number”

Read More
How to Style WP Nav Menu

If you’re creating your own theme and use adding a menu using the standard WordPress function wp_nav_menu(), you will have to style it using CSS in order to make it like the usual navigation menu. This function will return a list of menus you defined or added in Appearance -> Menus. This looks fine if

Read More