Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Remove requirement from adding items to constructor #1

Open
crutchcorn opened this issue Dec 21, 2020 · 0 comments
Open

Remove requirement from adding items to constructor #1

crutchcorn opened this issue Dec 21, 2020 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@crutchcorn
Copy link
Member

Right now, there's a requirement to have two items in your constructor if you intend to use props in the @Setup directive:

@Setup((props, detectChanges) => {
  // ...
})
@Component({
  selector: 'test'
})
class TestComponent implements OnChanges {
    // These two items in your constructor are required, currently
    constructor(private componentFactoryResolver: ComponentFactoryResolver, private cd: ChangeDetectorRef) {
    }

    // This is required, even if empty
    ngOnChanges() {}
}

These two items are confusing to new users, a bit janky of a requirement, can cause bugs when not present, and is generally just subideal for the usage of the library. I would love to figure out a way to remove these from the consuming component constructor

@crutchcorn crutchcorn added the help wanted Extra attention is needed label Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant