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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
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
javascript:Quix();function Quix() { | |
var e=encodeURIComponent; // shortcut for the function name | |
var t=window.getSelection ? window.getSelection(): | |
(document.getSelection? document.getSelection(): (document.selection ? document.selection.createRange().text:'')); // Get selection or empty string | |
var c=window.prompt('Quix: Type `help` for a list of commands:'); | |
if(t!='') { | |
if(c) { | |
c+=' '+t; // append selection to typed text | |
} | |
else { |
NewerOlder