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

ng-template include from jade to html #77

Closed michaeljoser closed 10 years ago

michaeljoser commented 10 years ago

Hi I am not a big fan of jade so i normally work with HTML files. But i've tried multiple things but i dont seem to be able to convert the below from JADE to HTML.

How can we achieve the same thing with only HTML? please help

      // Partial views... Load up front to make transitions smoother
        script(type="text/ng-template", id="404")
            include partials/404
        script(type="text/ng-template", id="admin")
            include partials/admin
        script(type="text/ng-template", id="home")
            include partials/home
        script(type="text/ng-template", id="login")
            include partials/login
        script(type="text/ng-template", id="private/layout")
            include partials/private/layout
        script(type="text/ng-template", id="private/home")
            include partials/private/home
        script(type="text/ng-template", id="private/nested")
            include partials/private/nested
        script(type="text/ng-template", id="private/nestedAdmin")
            include partials/private/nestedAdmin
        script(type="text/ng-template", id="register")
            include partials/register
michaeljoser commented 10 years ago

think i found it! So the below:

        script(type="text/ng-template", id="home")
            include partials/home

becomes

    <script type="text/ng-template" id="home" >
      <div ng-include src="'/partials/home.jade'"></div>
    </script>

its actually " + ' + /partials/home.jade + ' + " ... didnt know about the single quote inside double quote to be used there :)

fnakstad commented 10 years ago

Glad you solved it :) I really like to do this since the state changes become really fast once you load all partial views up front!