| How can I define the scheme of this app in Angular 2? | Elizabeth Manrique | 1/25/16 9:47 AM | Hi, I started to learn Angular.io about 1 month ago. Now I want to code an app for "calculation taxes" in my country(Peru). The app is very simple, the user just have to enter his incoming by month in input and the app should calculate his incoming for year(14*incoming_by_month) and calculate his tax for year, for tax the app need apply scales(scales should be provide for a service). For every scale the app calculate tax, that mean for example: First scale: For first 10k - 20k of incoming for year, tax is 8% of that 10k. Second scale: For next 20k to 40k tax is 14%. And son on until all incoming is affected by taxes and. I identified 2 components:TaxComponent, TaxDetailComponent and 3 classes: Tax, TaxDetail and Scale. Scale have a service: ScaleService, and that service provide a list of scales with the percents, range(10k - 20k, 20k-40k, etc). ScaleServices provide to TaxDetail a list of scales and TaxDetail calculate the tax for every scale and for that it needs the incoming by month enter by user in TaxComponent. For now I defined this scheme And this is my mockup for the app. I advanced this code for the app https://github.com/emanrique/sueldo_neto_2016. Any idea for define the scheme of the app are well comming. My big problem is how I can manage the bindings considering that calculation of taxes by TaxDetail depends of input entered by user in Tax component. Thanks. |