Re: [angular.js] Re: Can i use Angular.js with Hogan.js?

1,362 views
Skip to first unread message

Abdul Azeez Shaik

unread,
Jul 16, 2012, 12:22:19 PM7/16/12
to ang...@googlegroups.com
Hi Ricardo,

Thanks for the response.
Hogan.js provides the option of pre-compiled templates which makes rendering very fast.
Does Angular.js have the similar option(where i can pre-compile the template at server side and send it to client)?

Min version of Angular 1.0 version comes around 76kb. Can i reduce this size by selecting/removing few features from the framework?

~Azeez

On Mon, Jul 16, 2012 at 8:30 PM, Ricardo Bin <ricar...@gmail.com> wrote:
In my opinion, this is redundant. 

Angular already have his own $compile function, fully integrated with scope, directives, cache etc. 

You will add some unnecessary complexity to manipulate templates if you want to use hogan.js. And will miss one of coolest angular.JS features.


PS: to make compatibility with IE, use ng as attribute, instead of use as tags. If you want to use tag anyway, just 'register' them using document.createElement (http://docs.angularjs.org/guide/ie).

Em segunda-feira, 16 de julho de 2012 05h25min48s UTC-3, Abdul Azeez escreveu:
Dear all,

I am pretty new to Angular.js and found it very interesting to use it in my application. I have few queries which i couldn't find answers yet.
From the docs, it looks Angular.js provides its own templates. Also, i read some where 'ng' tags are not yet compatible with IE web browser.  Please correct me if i am wrong.

Can i use hogan.js for templates and Angular.js for mvc? Kindly let me know pros and cons for this approach. 

Appreciate any help regarding this.

Thanks,
Abdul 


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/Ik3XB3bkukIJ.

To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

Abdul Azeez Shaik

unread,
Jul 17, 2012, 11:50:18 AM7/17/12
to ang...@googlegroups.com
Yes, using node.js on server side and compiling the templates before sending them to browser/client.

On Tue, Jul 17, 2012 at 9:04 PM, Ricardo Bin <ricar...@gmail.com> wrote:
When you say pre-compile in server side, you means nodejs + hogan?

About reduce the size of lib, removing features from the framework... I dont recommend it, but its not impossible (their source is open...)
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/sv86b4oPsvcJ.

Abdul Azeez Shaik

unread,
Jul 17, 2012, 12:07:02 PM7/17/12
to ang...@googlegroups.com
Hi Andy,

Thanks for the response. 
I am developing an e-commerce application with social networking features. I was planning to use Backbone.js + Hogan.js for MVC architecture at client side, routing and for templates as well.
However, after going through Angular.js, am confused to select among Backbone.js and Angular.js.
I want my html designer and javascript developer to work as independent as possible. Using Backbone.js + Hogan.js, designer can develop hogan.js template, whereas developer can use Backbone.js integrating it with model, routers and controller.

Could you please guide me over this? Would Angular give me same flexibility as Backbone+hogan? Does it have all history+navigation features in the framework?
Appreciate any help here.

Thanks,
 Abdul

On Tue, Jul 17, 2012 at 9:26 PM, Andy Joslin <andyt...@gmail.com> wrote:
Angular is not a templating language like Hogan.  

Take the ng-repeat tag for example:
<ul ng-controller="MyController">
  <li ng-repeat="item in myList">
    {{item}}
  </li>
</ul>

Unlike a server-side templating language, this will not just get compiled then statically rendered. Angular (on the client), reads through the DOM and finds the ng-repeat tag, hooks it up to the MyController Javascript object, and whenever MyController's scope's myList changes, it appends/removes/re-orders the list accordingly.

Angular is way different from a templating language, it's more of an HTML parser that works live with your Javascript in the browser

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/6nUHMj99PWcJ.

Abdul Azeez Shaik

unread,
Jul 17, 2012, 2:40:22 PM7/17/12
to ang...@googlegroups.com
Thanks a lot for providing the information Andy. Will go through the given app as well as the tutorial.

Thanks once again,
Abdul

On Tue, Jul 17, 2012 at 10:06 PM, Andy Joslin <andyt...@gmail.com> wrote:
Angular does have navigation built in, you should check out angular-phonecat, the main tutorial app.  Check https://github.com/angular/angular-phonecat, in app/js/app.js, to see the routing.  I would highly recommend giving the tutorial (which makes the angular-phonecat app) at least a quick go-over: http://docs.angularjs.org/tutorial

And it is probably about the same difficulty for your HTML designer to use the ng- tags as it is to throw in a templating language and Backbone.  The thing with Angular is, your coder will write the logic, and your HTML write out how that logic is rendered.  There is no 'middle man', unlike BackboneView.render().

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/uUQfz8D2ZfwJ.
Reply all
Reply to author
Forward
0 new messages