Skip to content

Details on getting the other service methods to work (and a couple other things) #1

@mausolos

Description

@mausolos

Chris(topher), first I want to thank you for putting this together, it's really helped me understand PhoneGap/Cordova for the first time in almost a year of on/off struggling with all the crud out there that is incomplete or doesn't work.

We're doing a JSON-based project, and I figured out what I needed to do and wanted to share it (it would be great if you provided some counter-examples for each of the methods, perhaps in the demo code, but commented out?):

// in HomeView.js //////////
this.findByName = function() {
service.findByName($('.search-key').val()).done(function(employees) {
employees = $.parseJSON(employees); // add this in for JSON method
employeeListView.setEmployees(employees);
});
};

// in EmployeeView.js /////////
var EmployeeView = function(employee) {

this.initialize = function() {
    this.$el = $('<div/>');
};

this.render = function() {
  employee = $.parseJSON(employee); // add this in for JSON method
    this.$el.html(this.template(employee));
    return this;
};

this.initialize();

}

Finally, for the by-id employee card view, I had to surround the

    's in {{#each}}, or they wouldn't display (just like in the list view).

    Lastly, it would be really helpful to include build-release instructions, I had to hunt around a little for these, and they would make your guide complete:

    keytool -genkey -v -keystore ./my_keystore.keystore -alias my_keys -keyalg RSA -keysize 2048 -validity 100000

    Create ant.properties file in MyProject/platforms/android/
    Add the following:
    key.store=<path_to>/my_keystore.keystore
    key.store.password=
    key.alias=my_keys
    key.alias.password=

    cordova build android --release

    Again, thank you so much for creating this interactive workshop, it was truly a lifesaver!
    Charles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions