JohnGalt
JohnGalt

Reputation: 2881

What is ?ngModel?

When creating a directive in angular I believe you can use require: '^ngModel' to look back to a parent directive's model. However, does require: '?ngModel' look for the first model in the current directive?

Upvotes: 1

Views: 281

Answers (1)

CD..
CD..

Reputation: 74176

The required name can be prefixed with:

? – Don't raise an error if the controller isn't found
^ – Look for the controller on parent elements, not just on the local scope

ng-newsletter

Upvotes: 2

Related Questions