Row selection: ngModel is not defined.
See original GitHub issueThrows an error in the console even though I have an ng-model defined:
<table md-table md-row-select multiple ng-model="selected" md-progress="promise">
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
Why ng-model is not defined? - Stack Overflow
ngModel automatically creates properties only after the value changes first time. If you don't initialize the item.customSelected1 , item.
Read more >Angular scope not affecting selected row ng-model as expected
I'm trying to select a product from the suggest box. When a select a product, the qty and unit cost as to appear...
Read more >Top 18 Most Common AngularJS Developer Mistakes - Toptal
Sheer size of the AngularJS can easily lead to many mistakes. In this article you will learn about most common AngularJS developer mistakes...
Read more >How to use “ng-model” in AngularJS with EXAMPLES - Guru99
In this ng-model tutorial, we will learn basic to advanced concepts like attribute, how to use ng-model, input elements, Select element form ...
Read more >AngularJS ng-model Directive - GeeksforGeeks
The ngModel directive stores a variable by reference, not value. Usually in binding inputs to models that are objects (e.g. Date) or collections ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In your controller you need to define the model, so if you have
In you controller you will need to define
selected
.I had this problem as well but the solution was to initialize the ng-model variable to an empty array.
As @daniel-nagy said, in your controller you have to define the ng-model variable:
$scope.selected = [];
If you are using a variable such as
vm.selectedRow
then in your controller you will need:vm.selectedRow = [];
.If you only define
vm.selectedRow;
in the controller and don’t make it an empty array, it will give you theRow selection: ngModel is not defined
error.