$ npm install --save babel-cli babel-preset-es2015
$ npm install --save-dev jasmine
.babelrc:
{
"presets": ["es2015"]
function translateError(msg) { | |
var newErr = new Error(msg); // placed here to get correct stack | |
return e => { | |
newErr.originalError = e; | |
throw newErr; | |
} | |
} | |
async function asyncTask() { | |
const user = await UserModel.findById(1).catch(translateError('No user found')) |
$ npm install --save babel-cli babel-preset-es2015
$ npm install --save-dev jasmine
.babelrc:
{
"presets": ["es2015"]
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> | |
<channel> | |
<title>{{ sitename }}</title> | |
<description>{{ description }}</description> | |
<link>{{ baseUrl }}</link> | |
<atom:link href="{{ baseUrl }}/feed.xml" rel="self" type="application/rss+xml" /> | |
{{#each collections.entries}} |
// create file: | |
sudo vim /usr/share/applications/intellij.desktop | |
// add the following | |
[Desktop Entry] | |
Version=13.0 | |
Type=Application | |
Terminal=false | |
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png | |
Name[en_US]=IntelliJ |
app.constant("RouteManifest", { | |
"/login" : { | |
templateUrl: 'templates/login.html', | |
controller: 'LoginController' | |
}, | |
"/home" : { | |
templateUrl: 'templates/home.html', | |
controller: 'HomeController' | |
}, |
(written by @pawel)
We've got a number of bug reports opened for the $dialog
service and while some of them can be fixed by (relatively) simple changes to the existing code-base some other are difficult to solve due to the way current code is structured. Additionally the existing API would benefit from some some simplifications.
This docs aims to list existing issues and propose a new API plus some implementations details that would address existing issues.
As a remainder, docs for the current service are located here: https://github.com/angular-ui/bootstrap/blob/master/src/dialog/README.md
var rfc822Date = moment(yourDate).format('ddd, DD MMM YYYY HH:mm:ss ZZ') |
// GeoChart from https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart | |
// Try out by pasting code into: https://code.google.com/apis/ajax/playground/?type=visualization#geo_chart | |
function drawVisualization() { | |
var data = google.visualization.arrayToDataTable([ | |
['State', 'Foo Factor'], | |
['US-IL', 200], | |
['US-IN', 300], | |
['US-IA', 20], |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |