Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I am getting error Uncaught (in promise) SyntaxError: Unable to parse bindings.

3159653May 27 2016 — edited May 27 2016

I am following this link to Create a Web App with Oracle JET  Instead of Movie, I have employee. If you have any other example of Rest service with JET I can use please let me know.

I have my own rest service exposed as below endpoints:

(supports post/put/get/delete)

http://localhost.:3000/api/employees/

http://localhost.:3000/api/employees/XXXXXXX

I am doing the following in my factory.js

define(['ojs/ojcore'], function(oj) {

var QuickStartFactory = {

    resourceUrl: "http://localhost:3000/api/employees"

    // Create a single movie instance.

    createEmployeeModel: function() {

      var Employee = oj.Model.extend({urlRoot:     this.resourceUrl,

                                   idAttribute: "_id"});

      return new Employee();

    },

    // Create a movie collection.

    createEmployeeCollection: function() {

      var Employees = oj.Collection.extend({url:   this.resourceUrl,

                                         model: this.createEmployeeModel()});

      return new Employees();

    }

  }

  return QuickStartFactory;

});

I have the below in employees.js

define(['ojs/ojcore', 'knockout', 'QuickStartFactory', 'ojs/ojmodel', 'ojs/ojcollectiontabledatasource', 'ojs/ojtable', 'ojs/ojbutton'],

function(oj, ko, QuickStartFactory) {

var viewModel = {

    employeeCollection: QuickStartFactory.createEmployeeCollection(),

    dataSource: ko.observable(),

    // Called each time the view is shown to the user.

    initialize: function() {

      this.dataSource(new oj.CollectionTableDataSource(this.employeeCollection));

      this.employeeCollection.fetch();

      console.log()

    },

....

I am getting below error and the UI is stuck saying "fetching data"

Uncaught (in promise) SyntaxError: Unable to parse bindings.

Bindings value: text: $data.firstName       ? firstName       : '

Message: Unexpected token ILLEGAL (08:35:04:143 | error, javascript)

This post has been answered by Jim.Marion-Oracle on May 27 2016
Jump to Answer
Comments
Post Details
Added on May 27 2016
3 comments
1,022 views