Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AngularJS An Introduction to Two-Way Data Binding Two-Way Binding: ng-list

I am lost in AngularJS code challenge: a visual example of the goal would go a long way!

The challenge states: Create a text input that stores a comma-separated list of tags into the 'tags' data property.

I don't understand what needs to be done here, anybody has a hint for me? What is the end goal? Do we need Input type="text" or do we need a list control?

<!DOCTYPE html>
<html ng-app="myApp">
  <script src="js/angular.js"></script>
  <script src="app.js"></script>

  <!-- YOUR CODE HERE -->
  <pre>{{tags | json}}</pre>
  <input type="text" ng-model="tags" id="tagsEdit"/>


1 Answer

Joseph Perez
Joseph Perez
25,122 Points

You're gonna want to do this

<input ng-model="tags" ng-list type="text">

Here's some information on ng-list on angular's docs https://docs.angularjs.org/api/ng/directive/ngList I hope this at least points you in the right direction! :)