Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 19 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Injectable } from "@angular/core"; |
||
2 | import { UserModel } from ".."; |
||
3 | |||
4 | @Injectable({ |
||
5 | providedIn: "root", |
||
6 | }) |
||
7 | export class UserFactory { |
||
8 | public set factoryFunction(factoryFunction: () => any) { |
||
9 | this.privFactoryFunction = factoryFunction; |
||
10 | } |
||
11 | |||
12 | public create() { |
||
13 | return this.privFactoryFunction(); |
||
14 | } |
||
15 | private privFactoryFunction: () => any = () => { |
||
16 | return new UserModel(); |
||
17 | }; |
||
18 | } |
||
19 |