I have view on which I defined a custom tagName. I need to be able to read this tagName elsewhere in the program. Is there any way to do this?
JS Fiddle: http://jsfiddle.net/oportocala/VDMym/
var MyView = Ember.View.extend({
tagName: 'section'
});
Ember.Application.create({
ready: function () {
alert(MyView.tagName);
}
});
You are trying to access an instance variable from a class.
If you access the value from an instance of the view it works fine.
http://jsfiddle.net/VDMym/1/
Also, in Ember you need to use
getandsetmethods to access variables.EDIT:
If you really want a class variable use
reopenClassinstead ofextendwhen defining the view.