Posts = new Mongo.Collection("posts");
angular.module('app', ['angular-meteor', 'ui.router', 'ionic'])
.controller('PostCtrl', ['$scope', '$meteorCollection', '$state', '$ionicModal',
function ($scope, $meteorCollection, $state, $ionicModal) {
$scope.Posts = $meteorCollection(Posts);
}])
.config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise('/');
$stateProvider
.state('tabs', {
url: '/tab',
abstract: true,
views: {
main: {
templateUrl: 'tabs.html'
}
}
})
.state('tabs.feed', {
url: '/feed',
views: {
feed: {
templateUrl: 'feed.html',
controller: 'PostCtrl'
}
}
})
.state('tabs.help', {
url: '/help',
views: {
help: {
templateUrl: 'help.html'
}
}
})
}])
<template name="feed.html">
<ion-view title="Feed">
<ion-nav-buttons side="right">
<button class="button button-icon icon ion-compose" ng-click="openNewPostModal()"></button>
</ion-nav-buttons>
<ion-content class="has-header">
<ion-list>
<ion-item ng-repeat="post in Posts">
<h2>[[post.title]]</h2>
<p>[[post.description]]</p>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
</template>
<template name="tabs.html">
<ion-tabs class="tabs-positive">
<ion-tab icon="ion-checkmark" ui-sref="tabs.feed">
<ion-nav-view name="feed"></ion-nav-view>
</ion-tab>
<ion-tab icon="ion-help" ui-sref="tabs.help">
<ion-nav-view name="help"></ion-nav-view>
</ion-tab>
</ion-tabs>
</template>
I have tried the following with the necessary changes (curly braces instead of square, removed template name=".."
, renamed file to tpl
), which did not work:
.state('tabs.feed', {
url: '/feed',
views: {
feed: {
templateUrl: '"feed.tpl"',
controller: 'PostCtrl'
}
}
})
Could you please provide me with any guidance on how I could update the app with the current tab setup.