Skip to content

Instantly share code, notes, and snippets.

# Factories are used to give each class it's own dependency management
angular.module('myApp', ['ngCookies'])
.factory('BaseObject', ['$log', '$http', ($log, $http) ->
# The instance-classes are returned at the end of the factory and can be injected (unmodified)
class BaseObject
constructor: (@options) ->
send: (args) ->
$log.log('sending', args)
$http(args)
<!DOCTYPE html>
<html>
<head>
<title>jquery.tokeninput.js with angular.js</title>
<link rel="stylesheet" type="text/css" href="components/jquery-tokeninput/styles/token-input.css"/>
<link rel="stylesheet" type="text/css" href="components/jquery-tokeninput/styles/token-input-facebook.css"/>
<script type="text/javascript" src="components/jquery/jquery.js"></script>
<script type="text/javascript" src="components/jquery-tokeninput/src/jquery.tokeninput.js"></script>