View launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/samplemovieapp.dll",
"args": [],
View launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
"args": [],
View MovieOps.js
//Since, we have moved in module file itself, we don't need to specify module name explicitly, it wil be taken care by require js, which requested it
define([], function(){
"use strict";
/* load and save movies */
var STORE_NAME = "movies";
function savemovieData (movies) {
View MovieOps.js
//Since, we have moved in module file itself, we don't need to specify module name explicitly, it wil be taken care by require js, which requested it
define([], function(){
"use strict";
/* load and save movies */
var STORE_NAME = "movies";
function savemovieData (movies) {
View handlers.js
define("movieApp",["jquery","movieManagement"],function($,movieManagement){
/* event handlers */
function _addMovie(){
movieManagement.add();
}
function _clearMovie(){
movieManagement.clear();
}
function _saveMovie(){
View main.js
/*Require JS Config Section for including JQuery */
require.config({
paths:{
jquery: 'jquery-2.1.1.min'
}
});
//Defining modules
define("MovieOps", [], function(){
View movieApp.js
define("movieApp",["jquery","movieManagement"],function($,movieManagement){
/* event handlers */
// Its good idea to prefix private methods with _
function _registerEventHandlers() {
$("#new-movie-button").on("click", movieManagement.add);
$("#delete-all-button").on("click", movieManagement.clear);
$("#save-button").on("click", movieManagement.save);
$("#movie-list").on("click", ".delete-button", movieManagement.remove);
}
View jquery.js
require(["jquery","movieApp"],function($, movieApp){
/* initialize app */
movieApp.init();
});
View main.js
/*Require JS Config Section for including JQuery */
require.config({
paths:{
jquery: 'jquery-2.1.1.min'
}
});
//Defining modules
define("MovieOps", [], function(){
View movieApp.js
define("movieApp",["movieManagement"],function(movieManagement){
/* event handlers */
// Its good idea to prefix private methods with _
function _registerEventHandlers() {
$("#new-movie-button").on("click", movieManagement.add);
$("#delete-all-button").on("click", movieManagement.clear);
$("#save-button").on("click", movieManagement.save);
$("#movie-list").on("click", ".delete-button", movieManagement.remove);
}