Friday, June 30, 2017

Using filter filter example in Angular

<!doctype html>
<html>
<head>
    <script src="libs/angular.min.js"></script>
</head>
<body>
<div ng-app="myApp" ng-controller="myController">
Enter subject<br />
<input type="text" ng-model="subjectName" /><br />
<p>Selected subject name is <span ng-bind="subjectName"></span></p>
<ul>
    <li ng-repeat="subject in student.subjects | filter : subjectName">{{subject.name}}</li>
</ul>
</div>
<script>
    var app = angular.module("myApp", []);
    app.controller("myController", function($scope) {
        $scope.student = {
            subjects : [{"name" : "English"}, {"name" : "Mathematics"}]
        };
    });
</script>
</body>
</html>

Get Indian financial year based on date

This function lets you get the start and end date of Indian financial year based on given date. This can also be modified for US financia...