kaun jovi kaun jovi - 5 months ago 7
AngularJS Question

Code not rendering correctly on github.io

I am trying to put some code on my blog on github.io. It is pixyll theme on jekyll.

An example of the code is



```
<!-- Add some model -->
<input type="text" ng-model="hello-model"></input>
<!-- And show that up -->
<h1>{{hello-model}}</h1>

```





However, when it shows up on the blog. it is showing up without the {{ }}.



<!-- Add some model -->
<input type="text" ng-model="hello-model"></input>
<!-- And show that up -->
<h1></h1>





Can someone help me add the {{}} back in the blog.

Answer

That is because both AngularJS and Jekyll use {{ }} (binding and templates respectively).

You may solve your issue by using ng-bind. See here for the corresponding docs.
Essentially it would look like

<h1 ng-bind="hello-model"></h1>
Comments