Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一个带有属性的 Ember 类,如下所示:
User = Ember.Object.extend({ foo: 42 });
foo如果我只有类,我如何访问的值User?我不想.create实例化。
foo
User
.create
哼,试试看:
Ember.keys(User.proto()).forEach(function(prop){console.log(Ember.get(User.proto(), prop))})
我已经解决了:
User.proto().foo