Skip to content

Instantly share code, notes, and snippets.

View Vayvala's full-sized avatar

Michael Vayvala Vayvala

View GitHub Profile
// ES5
$scope.$watch(angular.bind(this, function() {
return this.someObject;
}), function (newValue, oldValue) {
// do some stuff
});
// ES6
$scope.$watch(() => this.someObject, function(newValue, oldValue) {
// do some stuff
$scope.$watch('someObject', function(newValue, oldValue) {
// do some stuff
}
resolve: {
root: path.resolve(__dirname),
alias: {
services: 'public/app/services',
components: 'public/app/components',
directives: 'public/app/directives',
core: 'public/app/core',
css: 'public/css',
libs: 'public/libs'
},
'use strict';
const colors = require('colors/safe');
const debug = require('debug');
const _ = require('lodash');
const debugLinks = {};
const categories = [
'cache',
'core',
export default function(app) {
app.directive('bookTabs', function() {
return {
restrict: 'E',
controllerAs: 'vm',
templateUrl: 'book-tabs.tpl.html',
controller: 'BookTabsCtrl'
};
});
};
$stateProvider
.state('book', {
abstract: true,
url: '/:book',
template: '<book-tabs />'
})
.state('book.about', {
url: '',
template: '<book-about />'
})
'use strict';
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const srcDir = 'public';
const dstDir = 'dist';
const entry = 'entry.js';
const output = 'bundle.js';