Angular controller ng-repeat breaks ionic UI components


#1

Am following a video tutorial and still can’t get the basic controller to work. The data from the controller is not binding to the view, it breaks the subheader UI component.

Here’s the code
app.js

angular.module('starter', ['ionic'])

.controller('CtrlList', function ($scope) {
  $scope.artists = [
  {
    name: 'Harry Jane'
    email: 'info@example.com'
  },
  {
    name: 'Mattiaus Kembley'
    email: 'info@matthiaus.com'
  }

  ];
});

index.html

<ion-pane>
  <ion-header-bar class="bar-dark">
    <h2 class="title">Artist List</h2>
  </ion-header-bar>
  <div class="bar bar-subheader 
    item-input-inset bar-light">
    <label class="item-input-wrapper">
      <i class="icon ion-search placeholder-icon"></i>
      <input type="search" placeholder="Search">
    </label>
  </div>

  <ion-content class="has-subheader" ng-controller="CtrlList">
    <ion-list>
      <ion-item class="item-thumbnail-left text-wrap" ng-repeat="list in artists">
      <img src="http://placehold.it/100x100" alt="Photo">
      <h2>{{list.name}}</h2>
      <h3>{{list.email}}</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam quaerat illo a hic eius vero ex minus iusto cupiditate. Dolorum sint minima at ipsum minus iure, et obcaecati veniam eos.</p>
      </ion-item>
    </ion-list>
  </ion-content>

</ion-pane>

#2
After tweaking the code for several hours, I've been able to get it working. I assigned the module to variable and then instantiated the controller with the var name. something like creating a new object and calling the controller method I guess.

NB... angujarjs v1.3.13

var randomName = angular.module('starter', ['ionic'])

randomName.controller('ListCtrl', function ($scope) {
  $scope.artists = [
    {'name': 'ifeanyi',
    'email': 'info@example.com'},
    {'name': 'Emeka',
    'email': 'info@emeka.com'}
  ];
})

#3

As far as being able to bind the data, this works without any issues.

As for the subheader, this is an issue. Can you open an issue of this and ping me on it? (@mhartington on github as well)