Add tab to 'Tabs' template


#1

Just starting out with this. I just wanted to add a new tab to the base template of tabs.

Ever thing else in the template can assumed to be the same apart from the changes below…

**Controllers.js**

.controller('SearchChains', function($scope) {
 });


**app.js**

.state('tab.search', {
  url: '/search',
  views: {
    'tab-search': {
      templateUrl: 'templates/tab-search.html',
      controller: 'SearchChains'
    }
  }
})

tabs.html
 <!-- Search Tab -->
 <ion-tab title="Search" icon="icon ion-search href="#/tab/search">
 <ion-nav-view name="tab-search"></ion-nav-view>
 </ion-tab>

I have created tab-search.html which is just a copy of one of the other templates. When I try and run this I get the following error in chrome

Uncaught SyntaxError: Unexpected token . in controllers.js

Why is this?


#2

Check the syntax in your Controllers.js. When you created your SearchChains controller, you likely forgot to remove the trailing semi-colon (:wink: from the controller listed above.

Only the last controller in your controller.js file should end with a semi-colon.