mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-05 22:35:14 +08:00
Input controls require `ngModel` which in turn brings in the `ngModelOptions` but since ngModel does this initialization in the post link function, the order in which the directives are run is relevant. Directives are sorted by priority and name but `ngModel`, `input` and `textarea` have the same priority. It just happens that `textarea` is alphabetically sorted and so linked before `ngModel` (unlike `input`). This is a problem since inputs expect `ngModelController.$options` to exist at post-link time and for `textarea` this has not happened. This is solved easily by moving the initialization of `ngModel` to the pre-link function. Closes #7281 Closes #7292