SideMenu and Navigation template and some questions


#1

Hi,

I’m new to ionic (and Angular in general) development and I wrote a template using side menu and navigation to get some experience, it works and you can find here:

Demo

but I’ve got some questions:

  • It’s right to use an < ion-nav-view > in the index page and than a < ion-side-menus > (in templates/sideMenus.html) ?
  • Am I doing the right thing using one controller for the nav-bar and one controller for < ion-side-menu > (templates/sideMenus.html and scripts/app.js) ?
  • Am I using in the right way ng-class (in templates/sideMenus.html) ?

In Chrome the nav bar is not shown (no problem on Safari, iOS simulator and Nexus 7) and I’m getting this error:

and I don’t know how to interpretate this.


#2

Any chance you can make that a simple CodePen sample? I just cloned it locally. Now, I have to npm install. Bower install. Grunt …

That’s a lot of work to ask people to review your code.

Without digging through your code, I can say their is no “right way” to do anything especially regarding controllers. Everyone has a different style. The “right way” is what works for you. There’s no sense getting into a best practices discussion because everyone will have their own best practice.


#3

Thanks for the reply, and sorry for the git annoyance, here you can find the CodePen sample:


#4

You were getting that error because all the Angular and Ionic stuff was in the body instead of the head.

See this updated sample : http://codepen.io/calendee/pen/kqfAL

In your action repo, put all of it in the head.


#5

@dcampogiani Have you solved?


#6

yes, no more errors in console.


#7

Is the github code updated?


#8

Yes, and I’ve also updated the readme with build instructions.