Skip to content

Instantly share code, notes, and snippets.

@Nevraeka
Created February 3, 2014 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nevraeka/8792033 to your computer and use it in GitHub Desktop.
Save Nevraeka/8792033 to your computer and use it in GitHub Desktop.
Angular Web Component Integration - Psuedo Code Concept
angular.module('web-platform', ["$ComponentSvc","$PolyfillSvc"]).component('ngw-picture',
["$components", function($components) {
return {
scope: {},
link: function($scope, $customElement, $attrs) {
var srcSets = $customElement.find('ngw-src-set');
// checks name for syntax - returns error if syntax is incorrect
// uses name to generate
// If this.shadow - isolated scope required (handle with error)
// $element becomes a jQLite wrapper around the custom element
// * registers element
// * exports element
// * creates $element.shadow (if exists)
// *
// Questions
// * How does this.priority work?
// * How do nested shadowRoots work?
// * Export to the module for component management (not window object)
// Generated injectables
// $import // gets the $element import if it exists
// $shadow // fetch $element shadowRoot
// $template // fetch the $element template
// Generated LifeCycle Events based on attrs
// $element.<attr>Changed
// $element.created
// $element.leave
// $element.enter
}
};
}
]);
angular.module('myApp', ['web-platform']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment