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

Remove requirement from adding items to constructor #1

Open
@crutchcorn

Description

@crutchcorn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions