Good Morning,
why there are two methods, who returning the almost the same result.
I know "only", that the method Method.fetch() returns a promise.
What is the main difference between this two methods?
They return different results :) fetch
returns a promise (as you said) immediately, which upon resolution will be your record. find
returns a record immediately (possibly empty). If the record already exists client side then it will return that record, if it doesn't, it's an empty record, and once ember model finishes fetching the data it will populate the record with it's properties. They both have their pros/cons. fetch
is safer for async programming if you depend on the record being populated before using it. find
is convenient for immediate response time, with delayed population. Click run inside the examples a few times to view the differences.
http://jsbin.com/UXOtOJI/20/edit