在ng-include的外部页面上使用ng-model
钢翼
编程
当我们需要在ng-include的外部页面上使用ng-model时,如果我们直接用$scope的变量,则会出现双向绑定失败。
正确的做法如下:
On the controller:
$scope.selection = {}On the HTML:
ng-model="selection.numLines"