Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Add a ui-for directive for associating form labels with inputs #59

Closed
@ProLoser

Description

@ProLoser

I don't want to have to ID every single <input> I use just so that my <label> can be properly attached. The need for an ID is also further rendered useless with the use of ng-model (which is essentially an identifier for the input). The idea would be that you could simply do and the label would automatically be attached to the (nearest/first?) input that uses that model.

Issues:

  • What if there are multiple inputs with the same ng-model? (probably should just use the first match or nearest match)
  • Is it acceptable to search the nearby DOM from within a directive (this is not normally done)
  • What if multiple inputs on the page use the same model, but represent different references (such as within ng-repeat)

Features:

  • Leverage existing IDs on the input if one is already present

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions