Menu icon Foundation
How to describe the resolve to Zurb Foundation

Hello everyone! My application works in conjunction Angular + Firebase. I need to carry out the inspection - an authorized user or not. You must registered the following code:

resolve: {
    // controller will not be loaded until $waitForAuth resolves
    // Auth refers to our $firebaseAuth wrapper in the example above
    "currentAuth": ["Auth", function(Auth) {
      // $waitForAuth returns a promise so the resolve waits for it to complete
      return Auth.$waitForAuth();
    }]
  }
            

         

Tell me how this is implemented in the application Zurb ?? Where and how to resolve the pattern described.

resolveAngularJSui routeroutingroute

Hello everyone! My application works in conjunction Angular + Firebase. I need to carry out the inspection - an authorized user or not. You must registered the following code:

resolve: {
    // controller will not be loaded until $waitForAuth resolves
    // Auth refers to our $firebaseAuth wrapper in the example above
    "currentAuth": ["Auth", function(Auth) {
      // $waitForAuth returns a promise so the resolve waits for it to complete
      return Auth.$waitForAuth();
    }]
  }
            

         

Tell me how this is implemented in the application Zurb ?? Where and how to resolve the pattern described.

Jeanie Chung over 4 years ago

Hey Anton-

In Foundation for Apps, we use ui-router. It looks like firebase has documentation (https://www.firebase.com/docs/web/libraries/angular/guide/user-auth.html#section-routers) for hooking up the authentication with ui-router. If you see the code snippet sample, you can switch it over to "ui-router" formatting, and then place that code in your app.js file. Your controller names may differ from the default firebase names provided in the sample.

Anton over 4 years ago

I watched the documentation and know that ui-route can resolve to implement. My question is what would resolve not write in js file but directly in the template. for example

---
name: reg
url: / reg
controller: regMainPazhe
resolve: function () {....}
---

So it works, but the inside did not write a function returns an error. I would like to know how all the same resolve to implement within the template