Getting Undefined error while using extended java script
Summary
I have extended the java script of product listing style widget. But when I tried to bind the observable from extended js to the template, it is giving error.Content
I have a standard widget Product listing style widget, I have extended the java script of the same from admin console. Within the extended java script I have created an observable and I am trying to bind that observable to the widget template code. But when I tried that I am getting undefined error in the console. Can you please help me in this.
Code Snippet
//template code
<span data-bind="text: firstname"></span>
//extended js
/**
* @fileoverview extendproductListing_v15.js.
*
* @author
*/
define(
//---------------------
// DEPENDENCIES
//---------------------
['knockout','viewModels/productListingViewModelFactory','CCi18n','ccConstants', 'pubsub', 'pageLayout/product', 'storageApi', 'ccStoreConfiguration'],
//-----------------------
// MODULE DEFINITION
//-----------------------
function (ko, ProductListingViewModelFactory, CCi18n, CCConstants, pubsub, Product, storageApi, CCStoreConfiguration) {
var widgetModal;
var repositoryId = widget.category().repositoryId;
console.log("rep id"+repositoryId);
"use strict";
return {
// myValue: ko.observable(false),
Tagged:
0