lucidworks/ngOrwell

Name: ngOrwell

Owner: Lucidworks

Description: A simple angular observer for AngularJs 1

Created: 2016-01-19 17:52:40.0

Updated: 2017-04-13 11:15:43.0

Pushed: 2016-04-11 20:56:09.0

Homepage: null

Size: 19

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ngOrwell

A simple angular observer for AngularJs 1

Install

You can install this package either with npm or with bower.

npm
install ng-orwell

Then add ng-orwell as a dependency for your app:

lar.module('myApp', [require('ng-orwell')]);
bower
r install ng-orwell

Add a <script> to your index.html:

ipt src="/bower_components/ng-orwell/Orwell.js"></script>

Then add ngOrwell as a dependency for your app:

lar.module('myApp', ['ngOrwell']);
Documentation

Orwell is a simple to use observable for AngularJs 1.

Including orwell in angular
p.controller('myController', function(Orwell){


Creating a observable
ll.createObservable(name, content);
Getting an observable
ll.getObservable(name);
Updating content on an observable

This will call all your observer callbacks who are observing this observable.

myContent = {
mething: 'something'

observable = Orwell.getObservable(name);
rvable.setContent(myContent);
Deleting an observable
ll.deleteObservable(name);
Adding an observer to an observable
observable = Orwell.getObservable(name);
observer = observable.addObserver(function(content){
 your callback code here.

Destroying an observer
observable = Orwell.getObservable(name);
observer = observable.addObserver(function(content){
 your callback code here.

pe.$on('destroy', function(){
servable.removeObserver(observer);

License

Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.