I am using a sample application with kendo mobile and require js. I am trying to navigate to a new view from another view. Once i go to the view, i have to alert or print a value. Like to check whenever i am in the view. I am using some sample code from kendo music store. I cant print anything inside that view. Find the below code.
main.js
var app;
require.config({
paths: {
jQuery: "../kendo/js/jquery.min",
kendo: "../kendo/js/kendo.mobile.min"
},
shim: {
jQuery: {
exports: "jQuery"
},
kendo: {
exports: "kendo"
}
}
});
require(["jQuery", "app"], function($, application) {
$(function() {
app = application
application.init();
});
});
app.js
define(["jQuery", "kendo", "about-view", "account-view", "utils", "home-view"], function($,
kendo, aboutView, accountView, utils, homeView) {
var _onError = function(error, url, line) {
};
var init = function() {
window.onerror = _onError;
var kendoApp = new kendo.mobile.Application(document.body, {
transition : "fade",
initial : "login-view",
loading : '<h1 class="loading-message">Loading...</h1>'
});
utils.init(kendoApp);
};
return {
aboutView : aboutView,
accountView : accountView,
utils : utils,
homeView : homeView,
init : init
};
});
Below is the new view i am creating to alert a value whenever i navigate to that view
define(["jQuery", "kendo", "utils"], function($, kendo, utils) {
return {
init: function(){
console.log("init home view");
},
};
});
my index.html has that view already, i am able to see the view once i navigate, but i cant do print or alert any value whenever i navigate to that view.
<div data-role="view" id="home-view" data-layout="home-layout" data-title="Home" data-model="app.homeView.viewModel">
<p>
Test para1
</p>
<p>Test para2
</p>
</div>
<!-- <script src="cordova.js"></script> -->
<!-- RequireJS is a JavaScript file and module loader(Below main.js file is set to load) -->
<script data-main="scripts/main.js" src="scripts/require.js"></script>