Skip to content

Instantly share code, notes, and snippets.

View navarroaxel's full-sized avatar

Axel Navarro navarroaxel

View GitHub Profile
@navarroaxel
navarroaxel / boweruninstallangularmocks.sh
Created June 3, 2014 18:42
bower uninstall angular-mocks for dev
bower uninstall angular-mocks --save-dev
@navarroaxel
navarroaxel / expressbower.js
Last active August 29, 2015 14:02
Public Javascript and CSS libraries using Bower and Express
// javascript and css libraries loaded using Bower.
app.use(express.static(path.join(__dirname, 'bower_components')));
@navarroaxel
navarroaxel / jquery.html
Created June 5, 2014 14:07
Loading jquery from bower
<script src="jquery/dist/jquery.js"></script>
@navarroaxel
navarroaxel / unorderedList.js
Last active August 29, 2015 14:03
Lexical Scope Problem
angular.module('exampleApp')
.directive('unorderedList', function () {
return function (scope, element, attrs) {
var data = scope[attrs['unorderedList']];
var propertyExpression = attrs['listProperty'];
if (!angular.isArray(data))
return;
var listElem = angular.element('<ul>');
@navarroaxel
navarroaxel / unorderedList.js
Last active August 29, 2015 14:03
IIFE problem fixed
angular.module('exampleApp')
.directive('unorderedList', function () {
return function (scope, element, attrs) {
var data = scope[attrs['unorderedList']];
var propertyExpression = attrs['listProperty'];
if (!angular.isArray(data))
return;
var listElem = angular.element('<ul>');
@navarroaxel
navarroaxel / defaultCtrl.js
Created July 7, 2014 19:10
A products controller
app.module('exampleApp', [])
.controller('defaultCtrl', function ($scope) {
$scope.products = [
{name: 'Apples', category: 'Fruit', price: 1.20},
{name: 'Bananas', category: 'Fruit', price: 2.40},
{name: 'Pears', category: 'Fruit', price: 2}
];
$scope.incrementPrices = function () {
for (var i = 0; i < $scope.products.length; i++) {
@navarroaxel
navarroaxel / index.html
Created July 7, 2014 19:29
Products page
<html>
<head>
<title>Directives</title>
<script src="bootstrap.css"></script>
<script src="bootstrap-theme.css"></script>
</head>
<body ng-controller="defaultCtrl">
<div class="panel panel-default">
<div class="panel-heading">
<h3>Products</h3>
$scope.addProviders = function() {
$scope.report.filters.providers = $scope.report.filters.providers.concat($scope.providersToAdd);
angular.forEach($scope.providersToAdd, function(provider) {
$scope.providers.remove(provider);
});
$scope.providersToAdd = [];
};
$scope.removeProviders = function(){
$scope.providers = $scope.providers.concat($scope.providersToDelete);
angular.forEach($scope.providersToDelete, function(provider) {
var async = require('async'),
nodemailer = require('nodemailer'),
_ = require('lodash'),
model = app.model,
hash = app.security.hash,
validate = app.validation.validate;
/**
* the mobile api should validate a token session from the mobile app
* @param router
@navarroaxel
navarroaxel / index.html
Created June 21, 2016 16:07
Angular UI Router
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body ng-app="app">
<main ui-view></main>
<script src="angular/angular.min.js"></script>
<script src="angular-ui-router/release/angular-ui-router.min.js"></script>