This file contains 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('__directives').directive('__Quantity', [ | |
function() { | |
return { | |
restrict: "E", | |
scope: { | |
quantity: '=' | |
}, | |
replace: true, | |
templateUrl: 'templates/quantitySpinner.html', | |
link: function(scope, element, attrs) { |
This file contains 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'; | |
angular.module('fontSize',[]).directive('adjustSizeToWidth',[function(){ | |
var valueToAdjustFor, container, textSpan, originalFontSize; | |
return function(scope, elm, attr) { | |
originalFontSize = attr.vwOriginalFontSize; | |
valueToAdjustFor = attr.vwAdjustSizeToWidth; | |
scope.$watch(valueToAdjustFor, function(){ | |
container = elm; | |
textSpan = elm.children()[0]; |
This file contains 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
window.MyCompany.Utilities = { | |
foo: window.MyModule.foo, | |
bar: window.MyModule.bar | |
} |
This file contains 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
{ | |
"name": "MyCompany", | |
"description": "example package.json", | |
"version": "0.0.1", | |
"scripts": { | |
"start": "grunt watch", | |
"build": "grunt build", | |
"test": "grunt test", | |
"analysis": "grunt analysis" | |
}, |
This file contains 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
module.exports = { | |
options: { | |
... | |
}, | |
build: { | |
files: { | |
'dist/MyCompanyModules.js': [ | |
..., | |
'node_modules/MyModule/build/MyModule.js' | |
... |
This file contains 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' | |
var MyModule = { | |
foo: function() { | |
//content with external dependency | |
return $.doSomething(); | |
}, | |
bar: function() { | |
//content |
This file contains 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(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(['jquery'], factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(require('jquery')); | |
} else { | |
root.MyModule = factory(root.jQuery); | |
} | |
}(this, function($) { | |
'use strict' |
This file contains 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('when creating a ThingViewModel', function () { | |
it('should return an object', function () { | |
var thingViewModel = new ThingViewModel(); | |
expect(typeof thingViewModel).toBe('object'); | |
}); | |
}); |
This file contains 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('when creating a ThingViewModel', function () { | |
var ctorArgs; | |
beforeEach(function(){ | |
ctorArgs = { | |
ThingApi: { | |
getThings: function(){} | |
}, | |
ThingUtility: {} | |
} | |
}); |
This file contains 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 example(options) { | |
const {injectedLibrary} = options; | |
//DON'T | |
this.methodOne = function(){ | |
doSomethingInjectedLibrary('methodOne') | |
} | |
this.methodTwo = function(){ | |
doSomethingInjectedLibrary('methodTwo') |
OlderNewer