LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

{{$taxPercent}}
  
Employee Details of {{name}}.
{{name}} earns monthly Rs. {{monthlysalary}} and works in {{department}} department.
Taxes:Rs.{{taxes}}
Net:Rs.{{netSalary}}
JS
	var myAppVar = angular.module('myApp',[]);
    myAppVar.run(function($rootScope) {$rootScope.taxPercent=30;});
    myAppVar.controller('EmployeeController', function($scope) {$scope.name="Ram"});
    myAppVar.controller('DeptController', function($scope) {$scope.monthlysalary=10000; $scope.department="Admin"});
    myAppVar.controller('TaxCalcController', function($scope, $rootScope) {
		$scope.taxes = (($scope.$parent.monthlysalary * $rootScope.taxPercent) / 100);
		$scope.netSalary = $scope.$parent.monthlysalary - $scope.taxes;
	});
Term
Wed, 12/27/2017 - 06:57

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv