Giter Site home page Giter Site logo

angularjselements's Introduction

Reactive Elements

AngularJS directives as native HTML elements (web components)

![Gitter](https://badges.gitter.im/Join Chat.svg)

Tiny Google Polymer or Mozilla X-Tags add-on which allows to use AngularJS components as custom HTML elements. Also works with a native Custom Elements implementation if present.

Demo

Example

Using component in HTML

<body>
	<my-angular-component items="{window.someArray}"></my-angular-component>
</body>

Angular directive definition

angular.module('demo', []).directive('angularList', function () {
    return {
        restrict: 'E',
        scope: {},
        template: '<ul><li ng-repeat="x in items">{{ x }}</li></ul>',
        link: function (scope) {
            scope.testMethod = function () {
                alert('Directive method called as node method');
            }
        }
    };
});

document.registerAngular('my-angular-component', 'demo');

Find complete examples in corresponding folder.

Nesting

Original content of a custom element is injected to component as:

<my-angular-component>Hello world</my-angular-component>

In this case we can use "Hello world" as transclude to "my-angular-component" directive.

Dependencies

License

MIT: http://mit-license.org/

Copyright 2015 Stepan Suvorov aka stevermeister, Denis Radin aka PixelsCommander

angularjselements's People

Contributors

stevermeister avatar pixelscommander avatar evaneus avatar gitter-badger avatar

Stargazers

Umair Munir avatar Harish Karumuthil avatar Danielle Blank avatar Rhy Moore avatar Noah Burney avatar Alex Urdea avatar Igor Kuznetsov avatar 无止休 avatar Pavlik Kiselev avatar Grace avatar Kristian Mandrup avatar Luca DeCaprio avatar Sean Lynch avatar tom zhou avatar Anatoly avatar  avatar Artur Parkhisenko avatar Lukáš Fryč avatar Vladimir Stolyarov avatar VonVictor V. Rosenchild avatar Artem avatar Mike Slattery avatar  avatar Erik Ringsmuth avatar

Watchers

James Cloos avatar  avatar

angularjselements's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.