fnakstad / angular-client-side-auth

One way to implement authentication/authorization in Angular applications
http://angular-client-side-auth.herokuapp.com/
MIT License
1.63k stars 346 forks source link

How to implement ui-router into project insteed of default angulars? #27

Closed egel closed 10 years ago

egel commented 11 years ago

Sorry for writing an issue here but don't know how to ask a question. I'm trying to implement ui-router insteed of default angualr's $routeProvider. It is possible to switch them? Because I have a serious problem to force it to work.

fnakstad commented 11 years ago

Hi egel!

I've been getting a lot of questions about how to use this example with UI-Router, and to be honest I'm not quite sure how to go about it yet... I think switching out the default routing would complicate things for new users who aren't familiar with all the available plugin modules, so I'm a little hesitant to include UI-Router in the main project.

Maybe I could create a fork of the main project with UI-router, but I won't have time to make something like that right away. So, in the meantime I could take a look at your project if it's publicly available...?

jcumminsr1 commented 11 years ago

@egel Hey there, I am very interested in this as well. What have you tried so far to get it to work?

fnakstad commented 11 years ago

I played around with it today, and was able to get ui-router working. I haven't done anything fancy with nested views and such yet, but I'll try to get that working properly too. Anyway, check out the branch called ui-router.

egel commented 11 years ago

Hi Guys, As well as you @fnakstad I'm successful in implementation of ui-route. My problem was a coffeeScript and his "conversion" (in some case very odd to me ;) ) of coffee to js. I also have some objects to global idea of accessLevels in routingConfig.js but this is for another topic ;) Generally I think you've done a great job in this repo and if I had some time in recent weeks I'd love to fork this repo and try to support this good looking example :)

fnakstad commented 11 years ago

Glad you figured it out, @egel! Did you try it out with nested views yet?

Also, a little heads up to anyone using Jade as their template engine: If you put boolean/value-less attributes in your tags, e.g. div(ui-view), Jade will compile this to HTML of the form <div ui-view="ui-view"></div>. This can be a problem if you don't want to give your view a specific name, and had me lost and confused for the longest time. You can however get around this by telling Jade your template is using doctype HTML5, in which case it will handle boolean attributes correctly. Just preface all your partial views with !!! 5.

jcumminsr1 commented 11 years ago

@fnakstad and @egel: thank you! I can't wait to play around with the ui-router branch and nested views.

jcollum-hcg commented 11 years ago

@fnakstad thanks for doing that, I was just about to do it myself but you did it for me, awesome!

fnakstad commented 10 years ago

This is now under way in the ui-router-migration branch. Please check this issue for more information.