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
/* From Modernizr */ | |
function whichTransitionEvent () { | |
var t, | |
el = document.createElement('fakeelement'), | |
transitions = { | |
'transition': 'transitionend', | |
'OTransition': 'oTransitionEnd', | |
'MozTransition': 'transitionend', | |
'WebkitTransition': 'webkitTransitionEnd' | |
}; |
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
// Creating a fake model called Unit | |
(function (angular) { | |
'use strict'; | |
// Unit Model Construtor | |
function Unit (futureUnitData) { | |
// Data is immediately available | |
if (! futureUnitData.inspect) { | |
// not sure if this is underscore, LoDash or something with angular | |
// need to research |
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
var s = document.createElement('script'); | |
s.setAttribute('type', 'text/javascript'); | |
s.setAttribute('src', 'script.js'); | |
document.getElementsByTagName('body')[0].appendChild(s); |
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
/** | |
* Assign or Create Angular Module | |
* | |
* The purpose of this is to first get the module if it exists, if not then create it | |
*/ | |
// NO WORK | |
var myTestModule = angular.module('myTestModule') || angular.module('myTestModule', []); | |
// WORKS - with the registeredModules.js file |
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 () { | |
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 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
<div ng-app="myApp"> | |
<ul ng-controller="myCtrl"> | |
<li ng-repeat="item in items | contains:'id':showList">{{ item.title }}</li> | |
<!-- | |
now instead of showing all items, it will only show list items with the id of 2 or 4 like below: | |
<li>two</li> | |
<li>four</li> | |
--> | |
</ul> |
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
import React, { Component } from 'react' | |
import { bool, object } from 'prop-types' | |
class StateProvides extends Component { | |
state = { | |
state: {}, | |
hydrated: false, | |
} |
OlderNewer