The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| 'use strict'; | |
| // simple express server | |
| var express = require('express'); | |
| var app = express(); | |
| var router = express.Router(); | |
| app.use(express.static('public')); | |
| app.get('/', function(req, res) { | |
| // res.sendfile('./public/index.html'); |
| promiseExmple(){ | |
| return new Promise((resolve, reject) => { | |
| setTimeout(()=>{reject('its been 5 sec')},5000) | |
| }); | |
| } | |
| /* ------------- */ | |
| this.user.promiseExmple().then((result)=>{ | |
| console.log("result: ",result) | |
| }).catch((err)=>{ | |
| console.log("promise failed: ",err) |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| ng-class="tadaONchange" <---use this on an item | |
| <button ng-click="tadaOnChange()"class="button">tada</button> | |
| $rootScope.tadaOnChange = function(){ | |
| console.log("$scope.tadaONchange: ",$scope.tadaONchange); | |
| $scope.tadaONchange = "tada"; | |
| $timeout(function () { |