Skip to content

Conversation

DallanQ
Copy link
Contributor

@DallanQ DallanQ commented Jan 21, 2014

Without this I get an Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed if I add more than one task to the Creating Tasks example, because each time $scope.createTask is called, the same $scope.task object (with an updated title) is pushed onto the array. Alternatively, you could setng-submit="createTask({title: task.title})" instead of createTask(task), but setting $scope.task = {} before showing the dialog also clears the task title so you see the placeholder text, which is nice.

@DallanQ
Copy link
Contributor Author

DallanQ commented Jan 21, 2014

This same change should be made when the TodoCtrl code is repeated under the Adding Projects header. I didn't look ahead to do that.

@DallanQ
Copy link
Contributor Author

DallanQ commented Jan 21, 2014

Wait, when the TodoCtrl code is repeated under the Adding Projects header, the createTask function contains:

$scope.activeProject.tasks.push({
  title: task.title
});

So a new object is created each time a task is pushed onto the array. That's another way to solve it. Maybe the solution is to push {title: task.title} onto the tasks array under the Creating Tasks example as well and ignore my pull request.

@pulkitsinghal
Copy link

@DallanQ I still think that the createTask method under the Creating tasks section (just before the Adding projects section) should be fixed because it causes some confusion for those who stop between sections and play around with the app. Why don't you resubmit your fix ... only this time you can fix it by copy-pasting the approach from Adding projects section into the Creating tasks section.

@DallanQ
Copy link
Contributor Author

DallanQ commented Feb 2, 2014

I agree. There are at least a couple of ways to fix it. I've given a pull request for one, and explained the other in the comment above. I'm not sure why it hasn't been fixed yet.

@mlynch
Copy link
Contributor

mlynch commented Feb 2, 2014

Thanks guys, we will get this fixed soon!

@ciastek
Copy link
Contributor

ciastek commented Feb 10, 2014

Sorry, haven't checked existig PRs and resolved it in #118 (https://github.com/ciastek/ionic-site/commit/1a43b9c2633e9cc2a686b09f7925c26a20489f3f). Solution matches the one used in createTask with projects.

@DallanQ
Copy link
Contributor Author

DallanQ commented Feb 10, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants