@{js(filename)}; @{css(filename)};

33 views
Skip to first unread message

Hasan A Yousef

unread,
Jan 4, 2014, 3:18:16 PM1/4/14
to part...@googlegroups.com
Hi Peter..
Typically, in applications, people put all JS files together, and I think this is the reason why partial have @js and @css.

I'm trying another approach,which is keeping all related files together, like the part in the right side of the picture here: http://i.stack.imgur.com/qDI2g.jpg

Is there something in partial, like @{} that enable me defining js and css easily.

Regards,
Hasan

Peter Širka

unread,
Jan 5, 2014, 4:54:58 AM1/5/14
to part...@googlegroups.com
I know what do you want ... You can create a custom helper for your requirements.

Thanks :-)

Hasan A Yousef

unread,
Jan 5, 2014, 5:46:37 AM1/5/14
to part...@googlegroups.com
Thanks Peter,
I defined the below, looks to be fine as first run, if some concern raised, will ping u :):


    @{login('js','loginCtrls')}
    @{login('css','loginStyle')}


framework.helpers.login = function(type, raw) {

        if (type == 'js')
       {
                     var obj="<script src=/login/"+raw+".js"+"></script>";
                  return obj
       }
       else
       if (type == 'css')
       {
                     var obj="<link href=/login/"+raw+".css rel=\"stylesheet\">";
                   return obj;
       }
       else
       return;
};


Hasan A Yousef

unread,
Mar 24, 2014, 4:11:26 PM3/24/14
to tot...@googlegroups.com, part...@googlegroups.com
Hi Peter,
customs helpers, as here, used to point to files in the "public" folder.
consider the "app" folder for ng-Applications, do I still need the "public" folder to be used in my custom helpers definitions! 

thanks
Reply all
Reply to author
Forward
0 new messages