recently I was told to start building an application on Ember Cli from scratch. After a lot of struggling and reading here and there I have been able to create an application with a few routes and pages. But as everybody know the ember-cli community is not that strong as yet and the documentation is completely useless.
Nevertheless, the problem is this: I have created a few routes:
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
this.route('admin');
this.route('profile');
this.route('logout');
this.route('paymenttypeslist');
});
Next I added the paymenttypelist.hbs in the templates. And then I added a paymenttypelist.js in app/route/ which has the following code:
import Ember from 'ember';
export default Ember.Route.extend({
model: function(){
return this.store.findAll('paymenttype');
}
});
Next I added a model named paymenttype in app/models which looks something like this:
import DS from 'ember-data';
var attr = DS.attr;
export default DS.Model.extend({
name: attr('string'),
inoutFlag: attr('string'),
shortCode: attr('string'),
paymentType: attr('string'),
bankAccountRequiredFlag: attr('string'),
depositSlipFlag: attr('string'),
maccPaymentFlag: attr('string'),
referenceRequiredFlag: attr('string'),
confirmationRequiredFlag: attr('string'),
creditCardRequiredFlag: attr('string'),
payeeRequiredFlag: attr('string'),
affectsBankAccountFlag: attr('string'),
clearanceRequiredFlag: attr('string'),
paymentRequiredFlag: attr('string'),
outstandingFlag: attr('string'),
includeInBankFile: attr('string'),
defaultDirectPayTypeCode: attr(),
inspecieTransferFlag: attr()
});
Next I created an adapter to get data named paymenttype in app/adapters/, which looks something like this: import DS from 'ember-data';
export default DS.RESTAdapter.extend({
host: 'http://localhost:8080/composerBackend/paymentTypes'
});
The problem is I cannot get my data from the server. It is appending the paymenttype defined in the route and when I try to edit my js file's name or delete the file and create new it is just not building the application. And I am stuck here. js hint error:
Build error
ENOENT, no such file or directory 'D:\Projects\LISP\TestCrudApplication\tmp\jshinter-cache_path-uACYF2gs.tmp\models\paymenttype.js'
I have tried the following: Rename the file to 'paymenttypes'. It bricked. Delete and create a new file with that name. It bricked again! Please help.
Can we not add and delete files for our ease in the project directory while working with the ember-cli. Can I turn off this jshint for a while, and generate its tests afterwards?
Aucun commentaire:
Enregistrer un commentaire