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
app.controllers | |
.controller('SupportTicketDetailsCtrl', ['TicketService', '$scope', '$stateParams', '$timeout', '$rootScope', function(Tickets, $scope, $stateParams, $timeout, $rootScope) { | |
$scope.stateParamsObjectId = $stateParams.objectId; | |
$scope.message = "Product Detail Controller"; | |
$scope.deleteReply = function(index) { | |
console.log("Current Ticket", index); | |
var innerQuery = Tickets; | |
innerQuery.get({objectId: $(objectId).text()}, function(res) { |
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
$(‘[id=*”abc-“]).each(function(e){ | |
if (e.css(display: none) { | |
// write function here | |
} | |
}) |
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 reduce(arr, fn, initial) { | |
return (function reduceOne(index, value) { | |
if (index > arr.length - 1) return value // end condition | |
return reduceOne(index + 1, fn(value, arr[index], index, arr)) // calculate & pass values to next step | |
})(0, initial) // IIFE. kick off recursion with initial values | |
} | |
module.exports = reduce |
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
// SECOND ATTEMPT AFTER CHAPTER 4 | |
(function(gridSize, charset){ | |
var grid = gridSize || 8, | |
chars = charset || ["X", "Y"], | |
chessBoard = {}; | |
chessBoard.isEven = function(num) { | |
return num % 2 == 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
m.buildView = function(element, node) { | |
try { | |
if (element !== 'string' || element !== 'object') throw new Error("Element needs to be a string or Object"); | |
// Set Element Equal to 1st Query Selector for Element | |
if (element === 'string') element = Array.prototype.slice.call(document.querySelectorAll(element))[0]; | |
// Set Element Equal to HTML Element | |
if (element === 'object' && element.constructor.name.search('HTML') >= 0) element = element; | |
m.alertClient('log', "ELEMENT IS?", element); | |
} catch (e) { | |
m.throwError(e.message, {arguments: arguments}); |
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
<?php | |
header('Content-type: text/html'); | |
header('Access-Control-Allow-Origin: *'); | |
$string = parse_str($_SERVER["QUERY_STRING"]); | |
$curl = curl_init(); | |
$timeout = 30; | |
$ret = ""; | |
if ($_REQUEST["data"]) { |
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(m, eId) { | |
// Define The Module To Be Instantiated | |
var AlertSystem = new m.constructor({ | |
name: 'AlertSystem', | |
state: { | |
current: "Dom Module Initialized", | |
last: m.getModuleProperty('state').prototype.memory | |
}, | |
init: this.init | |
}); |
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
define(function (require) { | |
// Function Executes with window[your-module.namespace] | |
// && selector of div to hold alerts eg: <div id='alert'></div> | |
// || <div class="alert"></div> | |
return (function(m, selector) { | |
// Define The Module To Be Instantiated | |
var that; | |
var AlertSystem = that = new m.constructor({ | |
name: 'AlertSystem', | |
state: { |
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
// Ionic Starter App | |
// angular.module is a global place for creating, registering and retrieving Angular modules | |
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html) | |
// the 2nd parameter is an array of 'requires' | |
// 'starter.controllers' is found in controllers.js | |
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'ngCordova']) | |
.run(function($ionicPlatform, $rootScope, $cordovaNetwork, $state, $authservice) { | |
$ionicPlatform.ready(function() { |
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
.factory('$authservice', ['$window', '$localstorage', '$state', function($window, $localstorage, $state) { | |
// Access local storage for existing user info | |
var SHIFT = $localstorage.getObject("Shift") | |
// Does session exist? | |
if (SHIFT && SHIFT.session.token) { | |
console.log("$authservice: Existing Session found: ", [SHIFT]) | |
} else { | |
console.log("$authservice: No session found.") | |
SHIFT = { | |
session: { |
OlderNewer