Skip to content

Instantly share code, notes, and snippets.

View aaronroberson's full-sized avatar

Aaron Roberson aaronroberson

View GitHub Profile
@aaronroberson
aaronroberson / app.js
Created April 30, 2014 23:58
AngularJS Controllers Part 1
// Initialize the module
angular.module('myModule', []);
// Access the module via angular.module('myModule');
// Add the controller to the module using method chaining
angular.module('myModule').controller('myController', function($scope) {
// Anything added to the scope is available to the view
$scope.name = 'Aaron Roberson';
});
@aaronroberson
aaronroberson / index.html
Last active August 29, 2015 14:00
AngularJS Modules Part 1
<!doctype html>
<html ng-app="myModule">
<head>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="name" placeholder="Enter a name here">
<hr>
@aaronroberson
aaronroberson / CSSRuleCounter
Created April 4, 2014 20:03
Counts the CSS Rules for each stylesheet
<script>
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}