emberjs on symfony2 dev enviroment dont work propertly
- by rkmax
I've builded a app with symfony2 the app expose an REST Api.
now i build a simple client for consuming
app.coffee - app.js
App = Em.Application.create
ready: ->
@.entradas.load()
Entrada: Em.Object.extend()
entradas: Em.ArrayController.create
content: []
load: ->
url = 'http://localhost/api/1/entrada'
me = @
$.ajax(
url: url,
method: 'GET',
success: (data) ->
me.set('content', [])
for entrada in data.data.objects
me.pushObject DBPlus.Entrada.create(entrada)
)
MyBundle:Home:index.html.twig
<script type="text/x-handlebars" src="{{ asset('js/templates/entradas.hbs') }}"></script>
<script src="{{ asset('js/libs/jquery-1.7.2.min.js') }}"></script>
<script src="{{ asset('js/libs/handlebars-1.0.0.beta.6.js') }}"></script>
<script src="{{ asset('js/libs/ember-1.0.pre.min.js') }}"></script>
<script src="{{ asset('js/app.js') }}"></script>
the problem here is when i run on dev enviroment and link the template like <script type="text/x-handlebars" src="{{...}}"> the app dont work, nothing show but works fine over prod enviroment.
he only way that works on dev enviroment is inline template
MyBundle:Home:index.html.twig
<script type="text/x-handlebars">
{% raw %}
<ul class="entradas">
{{#each App.entradas}}
<li class="entrada">{{nombre}}</li>
{{/each}}
</ul>
{% endraw %}
</script>
can explain why this behavoir?
Note: I disabled the debug profiler toolbar, and nothing