1

I'm confused why my {{item}} isn't being bound to the Controller's data object.

My HTML is just "{{item}}."

http://jsfiddle.net/rtFtA/3/

<div ng-controller="Controller">
<table>
    <tbody ng-repeat='items in data'>
      <tr ng-repeat='item in items'>
        <td>{{item}}</td>
      </tr>
    </tbody>
  </table>
</div>

.

function Controller($scope) {   
    $scope.data = ["Monday", "Tuesday", "Wednesday"];
}

1 Answer 1

1

You can fix your jsfiddle code by following these steps:

1> select a angularjs library (in Frameworks & Extensions on the left)

2> select no-wrap in head (or body)

3> wrap your code in ng-app, something like

<div ng-app='MyModule'>...</div>

4> add this to js section

var myModule = angular.module('MyModule', []);

here's an example

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

1 Comment

Thanks. Could you please tell me how to make each day a Column, rather than Row? jsfiddle.net/rtFtA/12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.