allenhwkim / angular-template

NodeJS AngularJS Server-Side Template Engine
34 stars 10 forks source link

Support for ng-class,ng-style,ng-bind-html not present #10

Closed pratikp91 closed 7 years ago

pratikp91 commented 7 years ago

Thanks for this library. But could you provide the above directives support

lf94 commented 7 years ago

I suggest just using regular templates.

<div class="{{ functionsThatOutputsCssClasses }}" style="{{ functionThatOutputsStyle }}"></div>

I remember I was able to output HTML too. I don't think angular-template cares about safe/unsafe HTML.

Keep in mind this is a VERY simple implementation of Angular 1.x.

lf94 commented 7 years ago

I would support these directives but only if I had some incentive...if you know what I mean, haha.

FDIM commented 7 years ago

I'll see what I can do. As it is now, ng-bind-html is not needed at all, you can just put your html in a variable and use it in a normal expression.

FDIM commented 7 years ago

I've introduced ht-class / ng-class support and restructured internals - now it's more modular and should be easy to extend. @pratikp91 are you up for a small challenge? :)

P.S. Package is not published to npm yet

allenhwkim commented 7 years ago

@FDIM thanks, you are the man!

FDIM commented 7 years ago

I've just published v2.1.0 that includes support for ng-class, ng-style, ng-bind, ng-bind-html. The last 2 doesn't bring much value, but are still nice for compatibility.