What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
| // This depends on a custom element polyfill for browsers | |
| // other than chrome and opera - 9/1/14 | |
| angular.module('CustomElemFactory', []) | |
| .service('customElem', [ | |
| '$window', | |
| function($window){ | |
| // hash of registered element types | |
| // that Angular knows about | |
| // note that this would NOT include CEs registered from | |
| // elsewhere |
| /*! | |
| * gulp | |
| * $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
| */ | |
| // Load plugins | |
| var gulp = require('gulp'), | |
| sass = require('gulp-ruby-sass'), | |
| autoprefixer = require('gulp-autoprefixer'), | |
| cssnano = require('gulp-cssnano'), |
What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
W3C Introduction to Web Components - explainer/overview of the technologies
| <div class="action-links"> | |
| <!-- Include our Angular web component in the page as html markup | |
| passing in (injecting) any data, config, or styling objects from the bckbone app--> | |
| <span angular-web-component | |
| og-id="{{model.id}}" | |
| og-url="{{model.url}}" | |
| og-key="{{model.key}}" | |
| og-title="{{model.title}}" | |
| og-image="{{model.image}}" |
| //Tibbr plugins html directives and associated controllers | |
| (function () { | |
| 'use strict'; | |
| //declare the plugins module with dependancies | |
| var tibbrPlugins = angular.module('TibbrPlugins', [ | |
| 'TibbrFilters', | |
| 'Tibbr', | |
| 'EventsBus', | |
| 'PageBus', | |
| 'TibbrAPI', |
| //Tibbr plugins html directives and associated controllers | |
| (function () { | |
| 'use strict'; | |
| //declare the plugins module with dependancies | |
| var tibbrPlugins = angular.module('TibbrPlugins', ['TibbrFilters', 'Tibbr', 'EventsBus', 'PageBus', 'TibbrAPI']); | |
| //code to run when a like tag is encountered | |
| tibbrPlugins.directive('tibrLike', function factory($window) { | |
| var directiveDefinitionObject = { | |
| //template: '<div>hi</div>', |
| var objectToQueryString = function (a) { | |
| var prefix, s, add, name, r20, output; | |
| s = []; | |
| r20 = /%20/g; | |
| add = function (key, value) { | |
| // If value is a function, invoke it and return its value | |
| value = ( typeof value == 'function' ) ? value() : ( value == null ? "" : value ); | |
| s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value); | |
| }; | |
| if (a instanceof Array) { |
| /* Copywrite 2012, David Shapiro - portions added to existing Backbone code*/ | |
| /* Subject to FFRUYL licensing - Feel free to rip and use as you like. */ | |
| /*globals Backbone:true, _:true, $:true*/ | |
| // @name: Configurator | |
| // | |
| // @tagline: Configurator for Backbone Apps- models, views and routers | |
| // |
| // generic paginator view functions and bindings | |
| // code here lifted from Adi Osmani's client example | |
| define(['order!underscore', 'order!Backbone'], function PaginatorView(){ | |
| var PaginatorView = Backbone.View.extend({ | |
| config: {}, | |
| //this should be overridden | |
| initialize: function(){ |