This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function promiseThatThrows(){ | |
return new Promise((resolve,reject) => { | |
throw new Error('!!This needs to be handled!!'); | |
}); | |
} | |
function correctNestedErrorHandling(){ | |
return new Promise((resolve,reject) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express=require('express'), | |
mongoose=require('mongoose'), | |
bodyParser=require('body-parser'), | |
app=express(), | |
WidgetSchema=new mongoose.Schema({ | |
name:{type:String,required:true}, | |
status:{type:Boolean} | |
} | |
), | |
Widget=mongoose.model('Widget',WidgetSchema); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.js"></script> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<script id="entry-template" type="text/x-handlebars-template"> | |
<div class="entry"> | |
<h1>{{name}}</h1> | |
<div class="body"> | |
weather: {{weather.0.description}} | |
</div> | |
</div> |