Skip to content

Angular directive for calculating mortgage loans...

License

Notifications You must be signed in to change notification settings

redapesolutions/dirMortgage

Repository files navigation

Angular Mortgage Widget (dirMortgage)

Angular directive for calculating mortgage loans...

Disclaimer: Not a fan of interest rates in any financial/commercial transactions

How to use

Basic Example

<div dir-mortgage></div>

or

<dir:mortgage></dir:mortgage>

with extra attributes

<dir:mortgage dm-template-url="" dm-principal-amount="160000"></dir:mortgage>
  • Other usable attributes
dmTemplateUrl - template url
dmPrincipalAmount - prinicipal amount/mortgage amount
dmDefaultRate - default interest rate per annum
dmMinRate - minimum interest rate per annum
dmMaxRate - maximum interest rate per annum
dmMinYear - minimum year term
dmMaxYear - maximum year term
dmStepRate - defined increment pattern for interest rate values e.g. 0.5, 0.2, 1
dmStepYear - defined increment pattern of years increase, see values above
dmCurrency - set locale currency

Installation

var app = angular.module('yourAppName',['dirMortgage'])

Configs

  • Setting attributes could also be done through a provider
var app = angular.module('yourAppName',['dirMortgage']);
app.config(function(dirMortgageServiceProvider){
  dirMortgageServiceProvider.setTemplatePath('/path/to/template');
});
  • other usable provider setter functions
  .setMinYear(float number)
  .setMaxYear(float number)
  .setStepYear(float number)
  .setMinRate(float number)
  .setMaxRate(float number)
  .setStepRate(float number)
  .setDefaultRate(float number)
  .setDefaultPrincipalAmount(float number)
  .setCurrency(string)

Bower Install

bower install angular-mortgage-widget

More Details

Setting Template Path

By default the template path as been set to, and can be found in:

  templates/dirMortgage.tpl.html

To rewrite or modify template, please do take a cue from the default one provided, with regards to scope vars and actions.

Default Minimum and Maximum Values

  • min year = 1
  • max year = 30
  • min rate = 0.5
  • max rate = 10
  • default rate = 4
  • step rate (step for interest rate increment) = 0.1
  • step year (step for year increase) = 0.1
  • currency = '$'
  • principal amount = 0.0

All, as depicted above, can be modified through the dirMortgageServiceProvider mutator methods, or added as attributes when implementing the directive

About

Angular directive for calculating mortgage loans...

Resources

License

Stars

Watchers

Forks

Packages

No packages published