Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- services/items.js:
- angular.module('App').factory('items', function() {
- var items = [
- { id: 0, name: 'Scruff McGruff' },
- { id: 1, name: 'G.I. Joe' },
- { id: 2, name: 'Miss Frizzle' },
- { id: 3, name: 'Ash Ketchum' }
- ];
- return items;
- });
- --------------------------------------------------------------------------
- controllers/items.js:
- 'use strict';
- angular.module('App').controller('ItemsController', function($scope, items) {
- $scope.items = items.query();
- })
- --------------------------------------------------------------------------
- tab-items.html:
- <ion-view title="Items">
- <ion-content>
- <ion-list>
- <ion-item ng-repeat="item in items" type="item-text-wrap" href="#/tab/item/{{item.id}}">{{item.name}} - {{item.description}}</ion-item>
- </ion-list>
- </ion-content>
- </ion-view>
- --------------------------------------------------------------------------
- app.js:
- .state('tab.items', {
- url: '/items',
- views: {
- 'tab-items': {
- templateUrl: 'templates/tab-items.html',
- controller: 'ItemsController'
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement