I am using starter kit from Emebr JS and added a simple anchor tag with {{action hello}} to application template.
I am pre-compiling the template with handlebars pre-compiler. When I tried to run this, it is throwing an error.
UnCaught Error: Could not find property 'action'
Previously I used to do the same thing with ember-1.0.pre.js, which was working fine. But When I included the new library of ember (ember-1.0.0-pre.2.js), it is throwing up this error.
In both the cases, I am using handlebars-1.0.rc.1.min.js.
Can anyone please help me out in fixing the issue. Detailed information of what handlebars and libraries I am using are listed below.
Template compiled with handlebars pre-compiler. application.handlebars
<h1>Hello from Ember.js</h1>
<a {{action hello}}>Say Hello!</a>
My HTML Page:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
<script src="js/libs/handlebars-1.0.0.beta.6.js"></script>
<script src="js/libs/ember-1.0.0-pre.2.min.js"></script>
<script src="handlebars/compiled/views.handlebars.js"></script>
<script src="js/app.js"></script>
views.handlebars.js contains the compiled handlebar.
App.js:
var App = Ember.Application.create();
App.ApplicationController = Ember.Controller.extend();
App.ApplicationView = Ember.View.extend({
templateName: 'application'
});
App.Router = Ember.Router.extend({
root: Ember.Route.extend({
index: Ember.Route.extend({
route: '/'
}),
hello: function() {
console.log("Hello and Welcome");
}
})
})
App.initialize();