Привет Я уголек нуб и когда я модернизировал последним данным Ember я получил эти предупреждения:Ember cli сломан новый выпуск данных ember?
Обновление: У меня есть две версии моего приложения одного построенного без Ember-кли, а другой с Ember кли как приложения точно такие же, оба они записывают эти сообщения на консоль:
DEPRECATION: Использование snapshot.constructor
устарело, используйте вместо этого snapshot.type
.
DEPRECATION: Использование DS.Snapshot.get() устарело. Вместо этого используйте .attr(), .belongsTo() или .hasMany().
Первый выскакивает дважды, и второй один раз сразу после я нажимаю предупреждение вот код:
Разница заключается в том, что приложение построено без Ember-кли работ!
Мне кажется, что это должно быть проблема с Ember-кли
import Ember from 'ember';
export default Ember.Controller.extend({
sortProperties:["time"],
sortAscending:true,
start:new Date(),
count:0,
incorrect:0,
startReview:true,
showHighScores:false,
actions:{
startReview:function(){
this.set('startReview',false);
this.set("showHighScores",false);
this.start = new Date();
this.count = 0;
this.incorrect = 0;
console.log(this.count);
},
showHighScores:function(){
this.toggleProperty("showHighScores");
},
checkCorrectness:function(word){
var textArray = this.get("model.text").split(" ");
var length = textArray.length;
if(word === textArray[this.count]){
console.log("correct");
this.count++;
console.log(this.count);
}else{
console.log("Incorrect");
this.incorrect++;
}
if(length === this.count){
var finish = new Date();
var time = finish-this.start;
var accuracy = (this.count/(this.count+this.incorrect)*100);
**alert("You took "+time/1000+" seconds! With "+accuracy+"% accuracy!");**
Сразу после я выберите это предупреждение предупреждения устаревания появляются
this.saveResult(time);
this.set('startReview',true);
}
},
},
Я думаю, набор и получить код ниже должны быть правонарушителями, но i не знаете, как изменить их, чтобы компилировать с последними дата Ember данных
randomizer:function(){
this.set("randomArray",this.get("model.text").split(" ").randomize());
}.observes("startReview"),
saveResult:function(timeTaken){
var date = new Date(),
userName = "TimTheGreat";
var score = this.store.createRecord('score',{
userName:userName,
date:date,
time:timeTaken,
verse:this.get('model'),
});
var controller = this;
var scores = controller.get("model.scores");
score.save().then(function(score){
scores.addObject(score).then(function(){
controller.get("model").save();
});
});
}
});
Heres ссылку на запись в блоге о выпуске последней версии Эмбер-данных http://emberjs.com/blog/2015/02/14/ember-data-1-0-beta-15-released.html
Так что ваш вопрос? –
Привет и приветствуем StackOverflow. Это форум Q & A, здесь сложно найти конкретный * Q *. Это больше похоже на отчет об ошибке. – Kato