<p>I believe there are ways to marry them and I've been exploring just that with Vue. I'm not an expert in plugin development but I believe it involves POSTing the AJAX to a custom controller that you write, which can then save entries to the database via the service layer. <a href="https://craftcms.stackexchange.com/questions/19061/updating-a-user-on-the-front-end-with-vue-js-and-axios">This post</a> I found useful as a place to start and has some good introductory information. This developer writes about his experience using Vue and Craft <a href="https://nystudio107.com/blog/using-vuejs-2-0-with-craft-cms" rel="nofollow noreferrer">here</a> and <a href="https://nystudio107.com/blog/autocomplete-search-with-the-element-api-vuejs" rel="nofollow noreferrer">here</a>.</p>

<p>Beyond that, I haven't seen a lot! But I'm curious to know the same thing. Indeed I would happily pay for a course if somebody were to make one. (Mijingo, I'm looking at you (Also at Udemy).)</p>

CC BY-SA 3.0
2017-05-22T14:46:59.307Z
2017-07-27T18:47:47.943Z
2017-07-27T18:47:47.943Z
Nathan D Huening
<p>I am just starting out on a project using both Craft and Angular. I ran into an early issue because both Angular and Twig use the {{ }} braces, but that was quickly fixed by changing Angular’s settings like in <a href="https://stackoverflow.com/questions/13671701/angularjs-twig-conflict-with-double-curly-braces">this Stackover flow post</a>.</p>

<p>As Christian noted in the comments, though, you could also use the <a href="http://twig.sensiolabs.org/doc/tags/verbatim.html" rel="nofollow noreferrer">{% verbatim %}</a> tag to keep Craft from parsing Angular tags.</p>

<p>Aside from that, I haven't had issues since Craft gives you full frontend control and there are no CMS scripts on the frontend to worry about. And (so far) Craft's dynamic routes make it really quite easy to set up your templates, JSON, etc.</p>

CC BY-SA 3.0
2014-07-04T14:50:38.620Z
Twig also has the [`{% verbatim %}`](http://twig.sensiolabs.org/doc/tags/verbatim.html) tag for sections  that shouldn't be parsed. I'd simply wrap my Angular code with that.
carlcs
CC BY-SA 3.0
2014-07-04T14:54:26.927Z
This is a great point - I've heard that some outside Angular modules may have braces hardcoded, so this may be a more surefire way for them to work properly.
Patrick Harrington
CC BY-SA 3.0
2017-07-27T21:35:07.713Z
Braces can be escaped too.
Dominik Krulak
CC BY-SA 3.0
2014-07-04T14:07:53.950Z
2014-07-05T18:53:44.207Z
2017-05-23T12:38:53.957Z
Patrick Harrington
<p>Does anyone have an experience in using Craft in conjunction with a front-end JS MVC/MVVM framework such as Backbone, Ember or Angular?</p>

<p>We have a project coming up where there may be a lot of JS state management requirement and AJAX calls required, and would like to access back-end data using JSON. However, there is also a strong need for a robust easy-to-use CMS as there will be a lot of content to administer.</p>

<p>My first port of call for this type of application would be some more general server-side framework such as Laravel, but Craft has sort of spoiled us with the content management side of things. </p>

<p>Is there any way of marrying Craft with this kind of project?</p>

<ajax><json>
Craft CMS and JS/MVVM frameworks
# Craft CMS and JS/MVVM frameworks

(Asked by: username_0 on 2014-07-04)

Does anyone have an experience in using Craft in conjunction with a front-end JS MVC/MVVM framework such as Backbone, Ember or Angular?

We have a project coming up where there may be a lot of JS state management requirement and AJAX calls required, and would like to access back-end data using JSON. However, there is also a strong need for a robust easy-to-use CMS as there will be a lot of content to administer.

My first port of call for this type of application would be some more general server-side framework such as Laravel, but Craft has sort of spoiled us with the content management side of things.

Is there any way of marrying Craft with this kind of project?

**Tags:** ajax, json


---

## 2 answers

### Answer by username_2 on 2014-07-04. Score: 5 | Accepted answer

I am just starting out on a project using both Craft and Angular. I ran into an early issue because both Angular and Twig use the {{ }} braces, but that was quickly fixed by changing Angular’s settings like in [this Stackover flow post](https://stackoverflow.com/questions/13671701/angularjs-twig-conflict-with-double-curly-braces).

As Christian noted in the comments, though, you could also use the [{% verbatim %}](http://twig.sensiolabs.org/doc/tags/verbatim.html) tag to keep Craft from parsing Angular tags.

Aside from that, I haven't had issues since Craft gives you full frontend control and there are no CMS scripts on the frontend to worry about. And (so far) Craft's dynamic routes make it really quite easy to set up your templates, JSON, etc.

> **Comments:**
> **username_3**: Twig also has the [`{% verbatim %}`](http://twig.sensiolabs.org/doc/tags/verbatim.html) tag for sections  that shouldn't be parsed. I'd simply wrap my Angular code with that.  
> **username_2**: This is a great point - I've heard that some outside Angular modules may have braces hardcoded, so this may be a more surefire way for them to work properly.  
> **username_4**: Braces can be escaped too.  

---

### Answer by username_1 on 2017-05-22. Score: 1

I believe there are ways to marry them and I've been exploring just that with Vue. I'm not an expert in plugin development but I believe it involves POSTing the AJAX to a custom controller that you write, which can then save entries to the database via the service layer. [This post](https://craftcms.stackexchange.com/questions/19061/updating-a-user-on-the-front-end-with-vue-js-and-axios) I found useful as a place to start and has some good introductory information. This developer writes about his experience using Vue and Craft [here](https://nystudio107.com/blog/using-vuejs-2-0-with-craft-cms) and [here](https://nystudio107.com/blog/autocomplete-search-with-the-element-api-vuejs).

Beyond that, I haven't seen a lot! But I'm curious to know the same thing. Indeed I would happily pay for a course if somebody were to make one. (Mijingo, I'm looking at you (Also at Udemy).)


---

