Reputation: 426
I expect to push new row for user to put in extra info but I'm stuck at generate the first row
<div ng-repeat="row in rows">
<input type="text" placeholder="name"><input type="tel" placeholder="tel">
</div>
$scope.rows = {
'1':1
};
}
http://plnkr.co/edit/qNPYKwdRPNXRrqphEfdz?p=preview
Upvotes: 1
Views: 63
Reputation: 143
In your plunker the html has a reference to a controller that doesn't exist.
Replace:
<html ng-app ng-controller="personController">
With:
<html ng-app>
In your controller you put a json object on scope
$scope.rows = {'1':1};
I suggest using a JSON array instead:
$scope.rows = [
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter","lastName":"Jones"}]
Regards Ian
Upvotes: 1
Reputation: 4636
You have ng-controller="personController"
but no implementation for that controller.
Upvotes: 0
Reputation: 3326
Because you have to remove ng-controller="personController"
from the html tag.
AngularJS is searching for that controller, but it doesn't exist, giving an error on the console.
Updated plunker
: http://plnkr.co/edit/N14qOlvzPF8eIuPj1I4U?p=preview
Upvotes: 2