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
define(function () { | |
var mapper = { | |
mapDtosToEntities: mapDtosToEntities | |
}; | |
return mapper; | |
function mapDtosToEntities(manager, dtos, entityName) { | |
// Map an array of DTO's for a type of entity | |
// to an array of Breeze entities that are managed by |
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
define( | |
function () { | |
var defaultExtension = { isPartial: true }; | |
var mapper = { | |
mapDtosToEntities: mapDtosToEntities | |
}; | |
return mapper; | |
/** |
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
describe('avengers', function () { | |
describe('avengers', function () { | |
var $controller, | |
dataservice, | |
$httpBackend, | |
$location, | |
$q, | |
$rootScope, | |
$route, | |
scope; |
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
(function () { | |
var root = $(document.getElementsByTagName('body')); | |
var watchers = []; | |
var f = function (element) { | |
if (element.data().hasOwnProperty('$scope')) { | |
angular.forEach(element.data().$scope.$$watchers, function (watcher) { | |
watchers.push(watcher); | |
}); | |
} |
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
angular | |
.module('app.core') | |
.factory('cranker', cranker); | |
cranker.$inject = ['$http', '$log', '$q']; | |
function cranker($http, $log, $q) { | |
var data; | |
return { | |
go: function () { |
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
angular.element(document).ready(bootstrapper); | |
// to boostrap you need to remove ng-app="app" | |
function bootstrapper() { | |
var initInjector = angular.injector(['ng']); | |
var someval = 'some id'; // here is what you would write in node | |
// or | |
// $http call to go get the value | |
//var $http = initInjector.get('$http'); |
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
/* jshint -W117, -W030 */ | |
describe('layout shell controller', function() { | |
var controller; | |
beforeEach(function() { | |
bard.appModule('app.layout'); | |
bard.inject(this, '$controller', '$log', '$timeout'); | |
controller = $controller('Shell'); | |
}); |
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 gulp = require('gulp'); | |
var $ = require('gulp-load-plugins')({ lazy: true }); | |
gulp.task('serve-dev', function () { | |
log(process.argv); | |
var nodeOptions = { | |
script: './src/server/app.js', | |
delayTime: 1, | |
env: { | |
'PORT': 8001, |
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'; | |
class DashboardController { | |
static $inject: Array<string> = ['$q', 'dataservice', 'logger']; | |
constructor(private $q: ng.IQService, | |
private dataservice: app.core.IDataService, | |
private logger: blocks.logger.Logger) { | |
var promises = [this.getMessageCount(), this.getPeople()]; | |
this.$q.all(promises).then(function () { | |
logger.info('Activated Dashboard View'); |
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
# A better git clone | |
# clones a repository, cds into it, and opens it in my editor. | |
# | |
# Based on https://github.com/stephenplusplus/dots/blob/master/.bash_profile#L68 by @stephenplusplus | |
# | |
# Note: code is already setup as a shortcut to VS Code. Replace with your own editor if different | |
# | |
# - arg 1 - url|username|repo remote endpoint, username on github, or name of | |
# repository. | |
# - arg 2 - (optional) name of repo |