This plugin disallows Dependency Injection within the constructor.
- ✒️ The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
Rules for switching Dependency Injection from constructor to inject function.
Deny: Dependency Injection within the constructor.
@Component({
selector: 'app-confirm',
templateUrl: './confirm.page.html',
styleUrls: ['./confirm.page.scss'],
})
export class SigninPage {
constructor(public platform: Platform) {}
}
Allow: Dependency Injection within the inject function.
@Component({
selector: 'app-confirm',
templateUrl: './confirm.page.html',
styleUrls: ['./confirm.page.scss'],
})
export class SigninPage {
public readonly platform = inject(Platform);
constructor() {}
}
No Options.