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
// this is an example . A simple function that | |
// calls a service that loads users from an ajax source | |
//@params {Number} page the number of the page to load | |
//@param {Number} limit the amount of items / results to load | |
//@param {Function} cb a callback function that gets called when | |
// and if results are returned. | |
$scope.load_users = function (page, limit, cb) { | |
adminService.loadUsers({ | |
page: page, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script type="text/javascript" src="angular.min.js"></script> | |
<script type="text/javascript" src="angular-ui-router.js"></script> | |
</head> | |
<body> | |
<nav id="mainmenu" class="mainmenu" ng-app="demoApp"> |
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
/* | |
* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at | |
* |
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
<body ng-app="offline-app"> | |
//include pouchdb js file | |
<script src="js/pouchdb.js"></script> | |
//bootstrap your angularjs main module | |
<script> | |
var app = angular.module('offlineApp', []); | |
app.factory('PouchDB', [function () { | |
return new PouchDB('offline'); | |
}]); |
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.factory('appDBBridge', [ | |
'$q', | |
'$injector', | |
'PouchDB', | |
function (Q, $injector, PouchDB) { | |
return { | |
/** | |
* returns a document saved in the db | |
* @param {[type]} query [description] | |
* @param {[type]} collectionName Usually a string which should be a dot-notation representation |
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.config(function($stateProvider, $urlRouterProvider....... | |
//........ | |
.state('files', { | |
url: '/files', | |
views: { | |
//adapt to fit your application | |
'cabinetContent' :{ | |
templateUrl: 'templates/files.html', | |
controller: 'FilerCtrl', | |
resolve: { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Lean Canvas by Koded</title> | |
<link rel="stylesheet" type="text/css" href="semantic.min.css"> | |
<script type="text/javascript" src="bower_components/angular/angular.min.js"></script> | |
<script type="text/javascript" src="semantic.min.js"></script> | |
</head> | |
<body> | |
<div class="ui stackable celled grid container"> |
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
<ul> | |
<li ng-repeat="place in places_list"> | |
<span city-state="place"> | |
{{place.formatted_address}} | |
</span> | |
</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
var MapApp = angular.module('GoogleMapsInitializer', []); | |
MapApp.factory('Initializer', function($window, $q){ | |
//Google's url for async maps initialization accepting callback function | |
var asyncUrl = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyCOt9IYHpYN22m7alw_HKi5y5WBgu57p4s&v=3.exp&sensor=true&callback=googleMapsInitialized', | |
mapsDefer = $q.defer(); | |
function init () { | |
var gMapsLoader = $.getScript(asyncUrl); | |
gMapsLoader.fail(function (err) { |
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 getRandomArbitrary(min, max) { | |
return Math.random() * (max - min) + min; | |
} | |
function solution(A, B) { | |
var startA = 0; | |
var startB = 0; | |
var a_move = 0; | |
while (startA <= A && startB <= B) { | |
//add our steps | |
startA += Math.round(getRandomArbitrary(1,2)); |
OlderNewer