Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

StyleGuide - Limit the usage of forwardRef #1151

Open

Description

@johnpapa

To be discussed ...

I copied several of these from early discussions and will list them as issues for future discussion after ngConf

cc // @mgechev @wardbell

  • Limit the usage of forwardRef.

    Why?: The usage of forwardRef indicates either a cyclic dependency or inconsistency in the services' declaration (i.e. the dependent service is declared before its dependency). In both cases there is usually a better approach to be used.

Activity

  1. traviskaufman commented on May 6, 2016

    @traviskaufman

    One place where forwardRef seems necessary is when components need to provide value accessors, e.g. for custom form controls. An example can be found in md-checkbox which provides a ControlValueAccessor so it can be used similar to a native checkbox. I'm not sure if there's been a better solution implemented since this code was written though.

  2. opporancisis commented on May 8, 2017

    @opporancisis

    Hi guys. Has anybody come up with how to make custom form controls without using forwardRef?

  3. meriturva commented on Jun 28, 2017

    @meriturva

    No solution here with Angular 4.
    @opporancisis did you find one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions