Hi,
I am new to JET. I was working on a sample project but I am facing this error.
I have app.js in same level as that of main.js in my project
JS
|------app.js
|------main.js
I have included 'app' in main.js like this :
require(['ojs/ojcore',
'jquery',
'app',
'knockout',
'ojs/ojknockout',
'ojs/ojbutton',
'ojs/ojchart'],
function (oj, ko, $) // this callback gets executed when all required modules are loaded
{
function FooterViewModel() {
---------------------
}
function FooterNavModel(name, id, linkTarget) {
-----------------------
}
function HeaderViewModel() {
---------------------
}
var vm = new app.vModel();
$(document).ready(function () {
ko.applyBindings(new HeaderViewModel(), document.getElementById('headerWrapper'));
ko.applyBindings(new FooterViewModel(), document.getElementById('footerWrapper'));
ko.applyBindings(vm, document.getElementById('globalBody'));
});
}
);
And I have my app.js like this :
define(['ojs/ojcore', 'knockout', 'jquery'],
function (oj, ko, $)
{
function viewModel() {
self.threeDValue = ko.observable('off');
var pieSeries = [{name: "Series 1", items: [42]},
{name: "Series 2", items: [55]},
{name: "Series 3", items: [36]},
{name: "Series 4", items: [10]},
{name: "Series 5", items: [5]}];
this.pieSeriesValue = ko.observableArray(pieSeries);
function XYZ(event, data) {
----------------------------------
};
function ABCD(event, data) {
----------------------------------
};
}
return {'vModel': viewModel};
});
But when I try to run my project I get the above mentioned error "Uncaught ReferenceError: app is not defined".
What am I doing wrong here ??
Thanks !!