2

I use the backand-app from ionic market. Now i try to have the login as a modal. On standard i have a login-tab, where user could do the login. But this is not really nice, so i want to do it with a modal and remove the login-tab.

And now the problem: The modal just do login when I open it on the login-tab. When I open it on an other site, for example objects or dashboard, the modal opens, but the login-buttons do nothing. I think it is a controller problem.

I uploaded the files to git: https://github.com/AndreDriesel/ionic-backand-app

Do you have any idea why it doesn't work?

Bourbon
  • 603
  • 3
  • 8
  • 17
  • Which buttons don't work? – Davide Pastore Jan 06 '16 at 13:16
  • The buttons from the modal for login, for example _facebook_, _google+_ or _git_. But only if you open the modal on the site _dashboard_ or _objects_. If you open the modal on the site _login_, all works fine. – Bourbon Jan 06 '16 at 13:22
  • You need to provide more detail. You said, "The modal just do login with I open it on the login-tab." So it works? YOu then say, "When I open it on an other site, for example objects or dashboard, the modal opens, but the login-buttons do nothing" - what other site? You mean another Ionic app?? – Raymond Camden Jan 06 '16 at 19:21
  • No. I got 4 tabs: _dashboard_, _objects_, _login_, _signup_. every tab has each own site. I got 3 buttons to open the modal: on site of tabs _dashboard_, _objects_, _login_. When I open the modal on _login_, everything works fine, just on the other two sites/tabs nothing happens. When you download and open the code, you will see what i mean. – Bourbon Jan 06 '16 at 20:37

1 Answers1

2

I found the reason why facebook login modal didn't work in your app. The view assume that LoginCtrl name is "login", so all methods is called with this assumption. For example "login.socialLogin('facebook')".

In your code, you call the right controller but don't give him appropriate name.

In code, you have to change a little line, and everything will work fine.

In tab-objects at line 25 old line is:

<button class="button button-icon ion-ios-person" 
ng-controller='LoginCtrl' ng-click="openModal()"></button>

and new one is like this

<button class="button button-icon ion-ios-person"
ng-controller='LoginCtrl as login' ng-click="openModal()"></button>
Ygalbel
  • 5,214
  • 1
  • 24
  • 32
  • Truthly, this was the failure :) Know I'm working on getting modal opened at start, when user isn't authorized (not logged in) ... it opens the modal, but has no function ... i think the rotoscope could use the controller – Bourbon Jan 25 '16 at 19:23