emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.47k stars 4.21k forks source link

Global lookup of <model attribute> from a Handlebars template is deprecated. #9555

Closed terryroe closed 10 years ago

terryroe commented 10 years ago

The backend API we call has attributes named with leading uppercase characters. When I try to use models in a template with attributes named this way, I get the following warning in the browser console:

Global lookup of Photo from a Handlebars template is deprecated.

Are model attributes required to start with a lowercase letter? Or perhaps there is a setting I should change to allow for this?

mixonic commented 10 years ago

@terryroe without an actual template to look at knowing what is going on is a bit odd, but...

Ember's get method, observer system, and template bindings all deal with capitalized strings in a different way. This is hold-over from Sproutcore 2. I Ember 1.x, using lower-case attributes will definitely be the happy path will less unexpected behavior.

In Ember 2.x capitalized object properties will probably Just Work the way you expect them to.

I'm going to close this, but feel free to re-open if I'm missing something!

terryroe commented 10 years ago

@mixonic Matthew, Thank you for your quick answer. You nailed it.