Co-existance of TerrificJS and AngularJS?

172 views
Skip to first unread message

Jiri Lundak

unread,
Feb 11, 2015, 8:02:22 AM2/11/15
to terrific...@googlegroups.com
Hi,
I understand that TerrificJS and AngularJS follow a different philosophy. TerrificJS more geared towards a generative approach vs AngularJS is very model-centric.

Say I would like to build a website using a CMS (like Sitecore). At the same time I have web applications using an in house developed application framework, using Angular JS. These and future web applications should share with the website a common look&feel, as they might be embedded into the portal.

It comes to mind to create a common Toolbox of controls to be used across web applications and the website, so as to seamlessly support responsive design.

How would one go about reconciling TerrificJS with AngularJS? What would be the overlap and potential conflicts?

Cheers
Jiri

Remo Brunschwiler

unread,
Feb 11, 2015, 8:50:03 AM2/11/15
to terrific...@googlegroups.com
Hi Jiri

The goal of TerrificJS is the modularization of your JS components. Not more, not less ;-) Therefore TerrificJS is very small and non-invasive. 

On the other side AngularJS offers way more features and has a total different, highly opinionated mindset. AngularJS also has its solution for modularization (ng-controller).
Therefore a usage of both (TerrificJS and Angular) on the same page is not really necessary. 

So as long as you use AngularJS for your model-driven application pages in your project and TerrificJS for the regular CMS stuff there shouldn't be any conflicts at all.
But when you start to mix them you have to be careful to not destroy javascript contextes, eg. AngularJS rerenders a part of the page and replaces a DOM-Node that contains TerrificJS logic. 

From a look and feel perspective – say html & css – you are fine to reuse the same patterns in both frameworks. But there may be some cases, where you have to implement the same logic in two places, eg. bind accordion or tabs logic.

Hope this helps

Cheers
Remo

Jiri Lundak

unread,
Feb 11, 2015, 9:24:42 AM2/11/15
to terrific...@googlegroups.com
Hi Remo,

Thank you for the quick response. It helps a lot to clarify assumptions made in the project.
Your answer shows, that there is no free lunch. Having pre-packaged ui-controls, that are created by a web agency and that can be reused within a CMS and a webapp context, without any modification or appropriate tweaking seams not to be a realistic expectation, the customer has.

Thanks again.

Jiri

Remo Brunschwiler

unread,
Feb 13, 2015, 9:10:32 AM2/13/15
to terrific...@googlegroups.com
Hi Jiri

Just to clarify: The answer is not no :-) I now of some projects where exactly AngularJS and TerrificJS has been successfully «married». And when it comes to HTML/CSS the reuse is 100%. 

But exactly the scenario above – where AngularJS rerenders a part of the page and replaces a DOM-Node that contains TerrificJS logic – needs some special handling (eg. calling the terrific bootstrap again for the rerendered part or make AngularJS controllers congruent with TerrificJS modules).

Nonetheless, TerrificJS code is very readably – as its pure JS and there is no voodoo going on ;-) – and therefore its easy to adapt or to pick & choose the relevant parts.

Cheers
Remo

Jiri Lundak

unread,
Feb 13, 2015, 2:37:22 PM2/13/15
to terrific...@googlegroups.com
Hi Remo,

I did not deduce that from your answer. Just imagined that there ist some tweaking necessary to prevent problems...so as always there is no free lunch. ;-)

Thank you.

Jiri

--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "Terrific" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/terrific-frontend/skgJ9_n_S1Y/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an terrific-front...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages