1

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

1

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

0

You have ng-controller="personController" but no implementation for that controller.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.