What are Web Components and how we use them. What is Angular Elements and how can we package our angular components as custom elements and reuse them everywhere.
Demos: https://github.com/iliaidakiev/slides/
The document discusses AngularJS and provides an introduction and overview. It describes AngularJS as an open source JavaScript framework developed by Google that uses MVC architecture and data binding. It discusses key AngularJS concepts like directives, scopes, controllers and views. It also covers communicating with servers using $http and $resource, and provides an example of writing a custom directive.
AngularJS is a JavaScript MVC framework developed by Google in 2009. It uses HTML enhanced with directives to bind data to the view via two-way data binding. AngularJS controllers define application behavior by mapping user actions to the model. Core features include directives, filters, expressions, dependency injection and scopes that connect controllers and views. Services like $http are used to retrieve server data. AngularJS makes building single page applications easier by taking care of DOM updates automatically.
Jquery Complete Presentation along with Javascript BasicsEPAM Systems
jQuery is a JavaScript library that simplifies HTML document manipulation and event handling. It allows developers to select elements, hide/show elements, and handle events with simple and concise code. jQuery animations and effects like fade, slide, and animate allow for creative transitions between states.
The document discusses how web pages are created using HTML, CSS, and JavaScript. It explains the Document Object Model (DOM) and how JavaScript can manipulate the DOM. It then provides an overview of AngularJS including what it is, how it works, and some key concepts like directives, dependency injection, services, and data binding.
Chicago Coder Conference 2015
Speaker Biography: Wei Ru
Wei Ru has over 15 years of professional experience in design and development of Java enterprise applications across multiple industries. Currently he works as a technical architect at STA Group, LLC. He received a M.S. degree in Computer Science from Loyola University Chicago. As a software developer with an emphasis on Java, he strongly believes in software re-usability, open standards, and various best practices. He has successfully delivered many products using open source platforms and frameworks during his IT consultancies.
Speaker Biography: Vincent Lau
Vincent Lau has been Senior Architect at STA Group in Chicago for the last two years. He received a B.S. degree in Accounting and Finance from the University of Illinois at Chicago and worked on M.S. of Computer Science at DePaul University. He has over 15 years of software design, development, testing and project management experience on large enterprise distributed computing platforms. Most recently, he has worked on web based applications using Java, Spring, JavaScript, Angular.js, jQuery and web services. He previously had Senior Software Engineer and Lead positions in Royal Caribbean Cruises, Wells Fargo Bank, Cap Gemini America and Trans Union Corp.
Presentation: Practical AngularJS
AngularJS has been seen gaining momentum recently. Whether you want to develop a modern single-page application or to spice up only the view enabled by a traditional MVC web framework, AngularJS allows you to write cleaner, shorter code. AngularJS’ two-way data binding feature allows a declarative approach on views and controllers, and ultimately code modulization. With this strategic change and many features offered by AngularJS, learning AngularJS can be challenging. In this session, we will share some of the experiences we had in Angular UI development, we will cover:
AngularJS modules and common project setup
Communicating to a Restful service
Commonly used Angular functions, directives
UI Bootstrap, grid views and forms in AngularJS
Custom Angular directives
Asynchronous functions and event processing
This document discusses using Angular and Three.js together for 3D modeling and visualization. It covers:
1. Different versions of a 3D viewer app including using controllers as view models and prototypal components.
2. Benefits of separating Three.js code from Angular UI code for reusability and productivity.
3. Details of the viewer app architecture including services, directives, controllers and factories for loading models and handling user interactions.
- Talk from FrontConf Munich 2017
- https://frontconf.com/talks/09-12-2017/reactive-type-safe-webcomponents
Abstract:
You know the drill right? new cool framework/library appears... boom! new Datepicker in that framework follows and soon enough whole UI libraries, again and again....
It's 2017 and it's time to stop this madness once and for all! How you ask?
In this talk we will go through implementation of an app via vanilla web components and explore all the pain points with all these low level primitives that we have natively in the browser.
In the end we will build our custom super tiny reactive type-safe library which will allow us to build web components with a breeze
Write once, use everywhere by using the platform + abstraction for great Developer experience.
The document provides an overview of AngularJS, including its core concepts and how it can be used with Java frameworks like Spring, Struts, and Hibernate. AngularJS is an open-source JavaScript framework that assists with building single-page applications using MVC architecture. It allows developers to specify custom HTML tags and directives to control element behavior. The document then discusses key AngularJS concepts like data binding, directives, expressions, filters, controllers, dependency injection, views/routing, and services. It provides examples of how these concepts work and how AngularJS can integrate with Java frameworks in a sample reader application divided into multiple sub-projects.
This document provides an introduction and overview of jQuery. It discusses how jQuery simplifies DOM navigation and manipulation, handles browser differences, and makes JavaScript coding easier. The document covers basic jQuery concepts like selectors, the jQuery function, attributes, and events. It also provides examples of common jQuery code.
[FEConf Korea 2017]Angular 컴포넌트 대화법Jeado Ko
This document summarizes Angular component communication patterns. It discusses using @Input and @Output to communicate between parent and child components. It also covers using a shared service to communicate between siblings and across the component tree. Services can utilize BehaviorSubject to share state updates through observables. Larger applications may use a state management library like NgRx to introduce a single source of truth via a centralized store.
This document provides an overview of AngularJS including:
- What AngularJS is and its features such as directives, filters, data binding, views, controllers and scope
- How it can be used to build single page applications (SPAs)
- Key directives like ng-app, ng-bind, and ng-model
- How to use filters, iterate with ng-repeat, and bind data
- The roles of views, controllers and scopes in AngularJS
- How to create controllers within modules and use factories
- How to create custom directives
- The differences between values, services, factories and providers
- How $watch and $watchCollection work
A talk i had about the solid principles at AngularJS-IL meetup #15. AngularJS is a great framework, it give you the tools you need to build robust single page web applications. Nut a good design and architecture are framework agnostic. By applying some well known object oriented principles to our angular application we can achieve more clean and modular code base.
The document discusses the components and utilities of the Backbone.js framework. It describes the key components of Backbone - Models, Collections, Views - and how they work together. Models contain interactive data and bind attributes to the DOM. Collections provide methods to manage ordered sets of models. Views handle templating and user interactions. The document also covers utilities like routing and events that help connect components.
AngularJS is an MVW JavaScript framework. It uses Model-View-Whatever architecture, with the "Whatever" standing for whatever works for the developer. Core concepts include templates, directives, scopes, expressions, filters, controllers and services. AngularJS enables two-way data binding between models and views. It also supports dependency injection to decouple code. Directives can be used to create reusable components in AngularJS applications.
jQuery is a JavaScript library that makes it easier to manipulate HTML and handle browser events. It provides tools to select DOM elements, handle events, create animations, and communicate with servers without page reloads. The $ alias is commonly used to access jQuery methods and properties. Code inside $(document).ready() will run when the DOM is ready to be manipulated. Common jQuery selectors include ID, class name, element name, and attributes to select elements on a page.
The document provides an overview of jQuery, including what it is, its syntax, basic usage, selectors, filters, events, and effects. jQuery is a powerful JavaScript library that simplifies common JavaScript tasks like selecting elements, modifying CSS, handling events, and animations. It provides cross-browser compatibility and AJAX support. jQuery selectors and methods allow selecting and manipulating page elements via CSS-like syntax.
Introduction to Angular JS by SolTech's Technical Architect, Carlos Muentes.
To learn more about SolTech's custom software and recruiting solution services, visit http://www.soltech.net.
JavaScript para Graficos y Visualizacion de Datos - BogotaJSphilogb
This document discusses using JavaScript for data visualization and graphics. It presents examples of collecting video data using HTML5 APIs, transforming the data with Web Workers and typed arrays, rendering 3D scenes with WebGL and PhiloGL, and interacting with forms. The examples show loading weather data and visualizing it over time by interacting with an HTML5 range slider. The conclusion argues that using HTML5 APIs directly with polyfills is preferable to monolithic frameworks for data visualization applications.
AngularJS is a JavaScript framework for building frontend web applications. It is inspired by Model-View-Controller (MVC) pattern and uses HTML templating with two-way data binding. Key features include DOM manipulation, validation, routing, and reusable components. The document provides an overview of AngularJS concepts like directives, data binding, controllers, modules, dependency injection, and built-in services. It also demonstrates how to create custom directives and use routing and resources services.
OpenCms 9.5 introduces the concept of “User Generated Content” (UGC). This new option allows front-end users to easily create or modify content elements in the OpenCms repository without access to the editor interface. The so generated XML contents can then be used with the standard template system to build web pages.
To enable UGC for your website, OpenCms 9.5 provides a simple to use JavaScript API. In addition to that, you just need to provide a schema for the XML content, a UGC configuration file, and a web form. No server side programming is required. Contents created with UGC can be edited in the standard editor interface and vice versa. Of course, UGC comes with build in security features.
Daniel and Alexander show how to create a UGC application in OpenCms. They explain common use cases and point out the advantages of the new API compared to the traditional approaches.
An overview of the Qt Model View architecture and practical examples of how to use this architecture for presenting large data sets in your application user interface.
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
This document provides an overview of various open source Ajax solutions including jQuery + DWR, GWT, and ZK. jQuery is a JavaScript library that simplifies DOM manipulation and AJAX requests. DWR allows making remote procedure calls from JavaScript to Java. GWT compiles Java code to JavaScript and supports component-based development. ZK is a server-centric framework that uses XML markup and allows building rich web applications in pure Java without writing JavaScript.
The document provides an introduction to jQuery, explaining what it is, its benefits over traditional JavaScript, and how it can be used. Key points covered include:
- jQuery is a lightweight JavaScript library that makes client-side scripting easier by providing cross-browser compatibility and methods for selecting, manipulating, and traversing DOM elements.
- jQuery solves many cross-browser issues that exist with traditional JavaScript and allows unobtrusive JavaScript that separates behavior from content.
- jQuery simplifies many common tasks like DOM traversal and manipulation through methods like $.(), selectors, events, effects, and plugins. This allows easier and more readable code compared to traditional JavaScript.
- The document provides examples of how to use
This document provides an overview and code samples for creating and handling various common UI elements programmatically in iOS, including:
- UILabel, UIButton, UITextField, UISlider, UISwitch, UIStepper, and UIImageView creation and event handling
- Changing background colors and UI element positions using slider values
- Getting input from switches, sliders, text fields and responding to button taps and other events
- Grouping elements together using a containing UIView
Single-page applications (SPAs) take user interaction with web applications to a new level. This means that more logic will be moved to the web browser and we have to become more familiar with JavaScript. AngularJS is one of the leading JavaScript frameworks when talking about SPAs. In this workshop I will present AngularJS in terms of problems it addresses and how it does this. Together we will develop a single-page application and we will go through how traditional concepts of web applications (data and state management, authentication) can be solved using the framework. Furthermore, we will dive into typical pitfalls when developing applications using AngularJS and will see how we can avoid them.
jQuery is a JavaScript library that simplifies HTML document traversing and manipulation, events, animations, and Ajax interactions for rapid web development. It provides a simple way to select elements, handle events, perform animations, and load data asynchronously. The document compares jQuery to other JavaScript libraries like Prototype and Mootools, and covers key jQuery APIs including DOM manipulation, events, Ajax, and animation. It also discusses how to include jQuery, use jQuery selectors, and work with other libraries using jQuery's noConflict() method.
Presented at phpXperts seminar 2009, Bangladesh.
A real quick start for jQuery learners.
http://tech.groups.yahoo.com/group/phpexperts/message/11888
This is a talk I gave the at the AngleBrackets/DevIntersection conference in April of 2014 that covers the AngularJS JavaScript framework (one of my favorite frameworks out there!). In this talk I discussed the challenges with Single Page Applications (SPA) and how AngularJS helps solve those challenges with built-in support for two-way data binding, directives and filters, controllers and more. I also discuss the relationship of modules to controllers, factories and services, and more.
Presentation about the native browser way for building web components. We look at examples and the pros and cons of doing it natively and using a library. At the end we look at the Angular way of wrapping custom components into Custom Elements.
This document provides an introduction and overview of jQuery. It discusses how jQuery simplifies DOM navigation and manipulation, handles browser differences, and makes JavaScript coding easier. The document covers basic jQuery concepts like selectors, the jQuery function, attributes, and events. It also provides examples of common jQuery code.
[FEConf Korea 2017]Angular 컴포넌트 대화법Jeado Ko
This document summarizes Angular component communication patterns. It discusses using @Input and @Output to communicate between parent and child components. It also covers using a shared service to communicate between siblings and across the component tree. Services can utilize BehaviorSubject to share state updates through observables. Larger applications may use a state management library like NgRx to introduce a single source of truth via a centralized store.
This document provides an overview of AngularJS including:
- What AngularJS is and its features such as directives, filters, data binding, views, controllers and scope
- How it can be used to build single page applications (SPAs)
- Key directives like ng-app, ng-bind, and ng-model
- How to use filters, iterate with ng-repeat, and bind data
- The roles of views, controllers and scopes in AngularJS
- How to create controllers within modules and use factories
- How to create custom directives
- The differences between values, services, factories and providers
- How $watch and $watchCollection work
A talk i had about the solid principles at AngularJS-IL meetup #15. AngularJS is a great framework, it give you the tools you need to build robust single page web applications. Nut a good design and architecture are framework agnostic. By applying some well known object oriented principles to our angular application we can achieve more clean and modular code base.
The document discusses the components and utilities of the Backbone.js framework. It describes the key components of Backbone - Models, Collections, Views - and how they work together. Models contain interactive data and bind attributes to the DOM. Collections provide methods to manage ordered sets of models. Views handle templating and user interactions. The document also covers utilities like routing and events that help connect components.
AngularJS is an MVW JavaScript framework. It uses Model-View-Whatever architecture, with the "Whatever" standing for whatever works for the developer. Core concepts include templates, directives, scopes, expressions, filters, controllers and services. AngularJS enables two-way data binding between models and views. It also supports dependency injection to decouple code. Directives can be used to create reusable components in AngularJS applications.
jQuery is a JavaScript library that makes it easier to manipulate HTML and handle browser events. It provides tools to select DOM elements, handle events, create animations, and communicate with servers without page reloads. The $ alias is commonly used to access jQuery methods and properties. Code inside $(document).ready() will run when the DOM is ready to be manipulated. Common jQuery selectors include ID, class name, element name, and attributes to select elements on a page.
The document provides an overview of jQuery, including what it is, its syntax, basic usage, selectors, filters, events, and effects. jQuery is a powerful JavaScript library that simplifies common JavaScript tasks like selecting elements, modifying CSS, handling events, and animations. It provides cross-browser compatibility and AJAX support. jQuery selectors and methods allow selecting and manipulating page elements via CSS-like syntax.
Introduction to Angular JS by SolTech's Technical Architect, Carlos Muentes.
To learn more about SolTech's custom software and recruiting solution services, visit http://www.soltech.net.
JavaScript para Graficos y Visualizacion de Datos - BogotaJSphilogb
This document discusses using JavaScript for data visualization and graphics. It presents examples of collecting video data using HTML5 APIs, transforming the data with Web Workers and typed arrays, rendering 3D scenes with WebGL and PhiloGL, and interacting with forms. The examples show loading weather data and visualizing it over time by interacting with an HTML5 range slider. The conclusion argues that using HTML5 APIs directly with polyfills is preferable to monolithic frameworks for data visualization applications.
AngularJS is a JavaScript framework for building frontend web applications. It is inspired by Model-View-Controller (MVC) pattern and uses HTML templating with two-way data binding. Key features include DOM manipulation, validation, routing, and reusable components. The document provides an overview of AngularJS concepts like directives, data binding, controllers, modules, dependency injection, and built-in services. It also demonstrates how to create custom directives and use routing and resources services.
OpenCms 9.5 introduces the concept of “User Generated Content” (UGC). This new option allows front-end users to easily create or modify content elements in the OpenCms repository without access to the editor interface. The so generated XML contents can then be used with the standard template system to build web pages.
To enable UGC for your website, OpenCms 9.5 provides a simple to use JavaScript API. In addition to that, you just need to provide a schema for the XML content, a UGC configuration file, and a web form. No server side programming is required. Contents created with UGC can be edited in the standard editor interface and vice versa. Of course, UGC comes with build in security features.
Daniel and Alexander show how to create a UGC application in OpenCms. They explain common use cases and point out the advantages of the new API compared to the traditional approaches.
An overview of the Qt Model View architecture and practical examples of how to use this architecture for presenting large data sets in your application user interface.
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
This document provides an overview of various open source Ajax solutions including jQuery + DWR, GWT, and ZK. jQuery is a JavaScript library that simplifies DOM manipulation and AJAX requests. DWR allows making remote procedure calls from JavaScript to Java. GWT compiles Java code to JavaScript and supports component-based development. ZK is a server-centric framework that uses XML markup and allows building rich web applications in pure Java without writing JavaScript.
The document provides an introduction to jQuery, explaining what it is, its benefits over traditional JavaScript, and how it can be used. Key points covered include:
- jQuery is a lightweight JavaScript library that makes client-side scripting easier by providing cross-browser compatibility and methods for selecting, manipulating, and traversing DOM elements.
- jQuery solves many cross-browser issues that exist with traditional JavaScript and allows unobtrusive JavaScript that separates behavior from content.
- jQuery simplifies many common tasks like DOM traversal and manipulation through methods like $.(), selectors, events, effects, and plugins. This allows easier and more readable code compared to traditional JavaScript.
- The document provides examples of how to use
This document provides an overview and code samples for creating and handling various common UI elements programmatically in iOS, including:
- UILabel, UIButton, UITextField, UISlider, UISwitch, UIStepper, and UIImageView creation and event handling
- Changing background colors and UI element positions using slider values
- Getting input from switches, sliders, text fields and responding to button taps and other events
- Grouping elements together using a containing UIView
Single-page applications (SPAs) take user interaction with web applications to a new level. This means that more logic will be moved to the web browser and we have to become more familiar with JavaScript. AngularJS is one of the leading JavaScript frameworks when talking about SPAs. In this workshop I will present AngularJS in terms of problems it addresses and how it does this. Together we will develop a single-page application and we will go through how traditional concepts of web applications (data and state management, authentication) can be solved using the framework. Furthermore, we will dive into typical pitfalls when developing applications using AngularJS and will see how we can avoid them.
jQuery is a JavaScript library that simplifies HTML document traversing and manipulation, events, animations, and Ajax interactions for rapid web development. It provides a simple way to select elements, handle events, perform animations, and load data asynchronously. The document compares jQuery to other JavaScript libraries like Prototype and Mootools, and covers key jQuery APIs including DOM manipulation, events, Ajax, and animation. It also discusses how to include jQuery, use jQuery selectors, and work with other libraries using jQuery's noConflict() method.
Presented at phpXperts seminar 2009, Bangladesh.
A real quick start for jQuery learners.
http://tech.groups.yahoo.com/group/phpexperts/message/11888
This is a talk I gave the at the AngleBrackets/DevIntersection conference in April of 2014 that covers the AngularJS JavaScript framework (one of my favorite frameworks out there!). In this talk I discussed the challenges with Single Page Applications (SPA) and how AngularJS helps solve those challenges with built-in support for two-way data binding, directives and filters, controllers and more. I also discuss the relationship of modules to controllers, factories and services, and more.
Presentation about the native browser way for building web components. We look at examples and the pros and cons of doing it natively and using a library. At the end we look at the Angular way of wrapping custom components into Custom Elements.
Reactive Type safe Webcomponents with skateJSMartin Hochel
This was presented at GUG Prague js dev meetup www.gug.cz/cs/akce/reactive-type-safe-webcomponents/terminy/1
You know the drill right? new cool framework/library appears... boom! new Datepicker in that framework follows and soon enough whole UI libraries, again and again....
It's 2017 and it's time to stop this madness once and for all! How you ask?
In this talk I will do an overview of component creation in terms of re-usability followed up with real life examples how to create performant, reactive, small and type-safe web components with tiny superpowered library called SkateJS.
Write once, use everywhere by using the platform.
Source code: https://github.com/Hotell/reactive-typesafe-webcomponents
SkateJS: https://github.com/skatejs/skatejs
The document summarizes new features in JavaScript 1.6 and 1.7 including:
- Iterative array methods like map(), filter(), forEach() added in 1.6.
- Generators and iterators introduced in 1.7 for optimized iterative generation of DOM elements.
- Let blocks allow block scope without needing a function in 1.7.
- Destructuring assignment allows extracting array elements or object properties into distinct variables.
The Web Components interoperability challenge - Horacio Gonzalez - Codemotion...Codemotion
Web Components are here, the v1 of the standard is ready, a new world of componentalized web is ahead us. But when you look at it, there are many ways to write them, lots of libs. And you ask yourself if that web component interoperability really works in real life. Does all those different components, work seamless together? We are going to introduce several ways to build your web components (vanilla components, Polymer, Stencil, SkateJS...) and write a component with each one. Then we will put all those components together in a web app showing you that the interoperability is a reality.
This document provides a summary of new features in JavaScript, including let/const block scoping, arrow functions, template strings, classes, generators, async/await, and more. It explains each feature in 1-3 sentences and includes code examples.
Web components allow developers to create reusable custom elements with encapsulated styles and markup. They include APIs for custom elements, shadow DOM, and HTML templates. Web components solve challenges like maintaining a consistent and unified UI across frameworks. Common problems are addressed through standards like custom elements, shadow DOM, and templates. Web components are supported across major browsers and offer benefits like portability, isolated styles, and execution speed.
This document provides answers to 15 questions from a final exam on Angular. The questions cover topics like the defer attribute, comparison operators, variable scoping, strict mode, the DOM, adding events, event bubbling, timeouts vs intervals, JSON parsing, AJAX calls, coding style guidelines, and more. For each question, a concise answer is provided explaining the key concept or resolving the example code provided.
This document contains the slides from a class on algorithms, computer graphics, and mathematics for game developers and computer scientists. The class covered introductions to JavaScript, computer graphics, and Three.js. It included discussions of debugging JavaScript code, the HTML DOM, Fibonacci sequences, Z-buffering, and more. The class was presented by Dr. Saajid Abuluaih and included code examples and references for further reading.
This lecture includes:
1. JavaScript DOM basics
2. Document object (frequently used properties and methods)
3. Element Object (frequently used properties and methods)
4. Node Object (frequently used properties and methods)
5. Location Object (frequently used properties and methods)
6. Window object (frequently used properties and methods)
- Lit-html is a library that allows HTML templates to be rendered efficiently using JavaScript template literals. It parses template literals and creates a template object with "parts" that can be updated.
- Rendering only updates the dynamic parts of the template, avoiding re-rendering the entire template and reducing work. Templates are treated as values that can be manipulated.
- Google is working on lit-html to standardize its parsing of templates and "template parts" concept, with the goal of it potentially being adopted directly into the web platform. Lit-html aims to have minimal limitations and a standardized public API for extensions.
Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27Horacio Gonzalez
Polymer par-ci, Polymer par-là, c'est bien beau de voir tout ce qu'on peut faire avec cette bibliothèque…
Mais à la base le discours qu'on nous vend depuis des années est celui des Web Components, des briques modulaires et interopérables, suivant un standard et pouvant être mélangés comme on le souhaite pour construire des webapp comme si on faisait du LEGO.
Alors, il n'est pas contradictoire de militer pour les Web Components et d'utiliser Polymer ?
Ben, pas du tout ! Polymer, surtout depuis la sortie de Polymer 2, n'est qu'une surcouche de sucre syntactique au dessus du standard Web Components, et les éléments créés avec Polymer sont bel et bien des Web Components standard.
De la même façon, il y a plein d'autres bibliothèques de Web Components qui ont un rôle semblable : SkateJS, SlimJS, BramJS... Chacune orientée vers une sensibilité et une façon de coder. Et bien entendu, les éléments créés avec eux se mélangent sans soucis, car ils suivent tous le même standard.
Dans ce talk nous allons voir comment ces éléments Polymer sont construits à partir du standard web components, voir ce côté sucre syntactique et comprendre ce qu'ils apportent. Ensuite on verra rapidement les bases de SkateJS et de SlimJS pour finir par prouver l'intéropérabilité avec une petite application qui mélange du Web Component standard, du Polymer, du SkateJS et du SlimJS.
The document discusses various topics related to the Document Object Model (DOM) including:
- The DOM defines the logical structure of documents and allows programs to access and manipulate HTML/XML documents.
- It represents documents as trees of nodes that can be traversed and manipulated.
- The history of the DOM is intertwined with the "browser wars" and development of JavaScript.
- There are different levels of the DOM specification with Level 1 providing core/HTML interfaces and later levels adding functionality.
This document provides an overview of common DOM methods for reaching and manipulating elements, nodes, and attributes in a document object model. It describes methods for getting elements by ID or tag name, creating new nodes, reading and setting attributes and node values, navigating between nodes, and inserting, removing, and replacing nodes. It also notes some browser quirks to be aware of when working with the DOM.
This document discusses component-driven web development and HTML5 Web Components. It defines what components are and their characteristics of being independent, composable, and deployable. It explains how to break a web page into reusable components and represent them as a tree structure. It also covers different types of components, data flow patterns like two-way binding and Flux, and emerging HTML5 Web Component standards like templates, imports, shadow DOM, and custom elements to build encapsulated and reusable components.
This document provides an overview of functional programming using Underscore.js and Lo-Dash. It discusses key concepts of functional programming like pure functions, first class functions, and higher order functions. It then explains how Underscore.js and Lo-Dash support functional programming in JavaScript with functions like compose, map, reduce, filter, and utilities to work with functions as first class citizens. The document compares Underscore.js and Lo-Dash, noting Lo-Dash's better performance, larger feature set, and utilities like partial and result. It emphasizes applying functional concepts judiciously for benefits while avoiding rewriting all code to be purely functional.
From Nicole's talk at JSConf.eu where she presented her wish list for the future of CSS. She presents a brand-new expanded syntax which allows for prototypes, mixins, and variables and explains how a preprocessor can be used today to achieve a richer language in older browsers.
2014 03-25 - GDG Nantes - Web Components avec PolymerHoracio Gonzalez
Web Components are a W3C standard for building reusable custom elements with encapsulated styles and markup. They include features like templates for reusable markup, shadow DOM for encapsulation, custom elements for defining new types of elements, and imports for loading elements from external files. Frameworks like Polymer and X-Tags provide polyfills to bring these features to browsers that don't natively support them yet. Web Components allow developers to build encapsulated, reusable custom UI elements and enable new patterns for component-based development.
Build Reusable Web Components using HTML5 Web cComponentsGil Fink
This document discusses using HTML5 Web Components to build reusable web components. It introduces several emerging Web Component standards including templates, imports, shadow DOM, and custom elements. Templates allow defining reusable DOM fragments, imports enable bundling HTML, CSS and JavaScript into a single component, shadow DOM provides DOM encapsulation, and custom elements define new semantic elements. While still in draft, Web Components aim to improve code reuse, encapsulation, separation of concerns and composition on the web. The presentation provides examples and demonstrations of each standard.
Enterprise State Management with NGRX/platformIlia Idakiev
Angular. State Management Problems. Redux. Understanding what is RxJS by comparing it to promises. Creating a simple app using ngrx/store and ngrx/effects. State Management Practices @ hillgrand.com.
This document provides an in-depth overview of Zone.js and how it works. It discusses:
- The event loop and how Zone.js intercepts asynchronous tasks like setTimeout and promises.
- How zones provide execution contexts and how Zone.js uses zones to observe and control code execution.
- How zones can be forked to create child zones and intercepted using hooks to monitor asynchronous tasks.
- How Zone.js monkey patches browser APIs and schedules tasks through the current zone rather than calling APIs directly.
Schedulers are a very powerful way of controlling the execution of the Reactive Extensions for JavaScript streams. In this presentation we examine the different types of schedulers and the different queues in the JavaScript runtime (Tasks and Micro tasks)
Deep dive into where Promises and Observables originate and why the Array.prototype.map function is called map. After understanding what functors and monads are we see the differences between Promises and Observables. Reactive Programming / Functional Programming
Unit Testing RxJS streams using jasmine-marbles. The demo shows how we can create a Web Component that uses NGRX/store + NGRX/effects like workflow and how we test our effect streams
Presentation about my experience in developing deterministic JavaScript Applications. Thoughts on Redux and problems surrounding it. And how finite state machines/statecharts can help us (xstate).
Demos Location:
https://github.com/IliaIdakiev/slides
State management for enterprise angular applicationsIlia Idakiev
This document discusses state management for enterprise Angular applications. It covers different state management approaches like Flux, Redux, and NgRx/Platform. It describes the types of data that need to be managed in applications. It also discusses layering concepts and different patterns for structuring application logic and state, including transaction scripts, domain models, and separating concerns with services. Reactive extensions and RxJS are presented as ways to manage asynchronous and reactive state changes.
Offline progressive web apps with NodeJS and ReactIlia Idakiev
This document provides an overview of progressive web applications (PWAs) and how to build them using service workers, the Cache API, and IndexedDB for offline functionality. It discusses key concepts like the service worker lifecycle, notifications, manifest files, and the Web Push API. The document also explains how to cache assets, handle network requests when offline, and store data locally using IndexedDB.
Testing rx js using marbles within angularIlia Idakiev
This document discusses testing RxJS observables using marble diagrams with Jasmine and Jasmine-Marbles. It introduces cold and hot observables, provides examples of marble diagram syntax for observables, subscriptions, and tests, and demonstrates how to test asynchronous RxJS code synchronously using the TestScheduler.
Predictable reactive state management for enterprise apps using NGRX/platformIlia Idakiev
Predictable reactive state management for enterprise apps using NGRX/platform:
@ngrx/store - RxJS powered state management for Angular applications, inspired by Redux
@ngrx/effects - Side Effect model for @ngrx/store to model event sources as actions.
@ngrx/router-store - Bindings to connect the Angular Router to @ngrx/store
@ngrx/store-devtools - Store instrumentation that enables a powerful time-travelling debugger.
@ngrx/entity - Entity State adapter for managing record collections.
Angular/NX Overview.
Angular Offline Progressive Web Apps With NodeJSIlia Idakiev
Angular Offline Progressive Web Apps With NodeJS
- Service Workers
- Application Manifest
- Cache API
- IndexedDB
- Notification API
- Web Push Protocol
- Real Time Communication
- HTTP/2
Introduction to Offline Progressive Web ApplicationsIlia Idakiev
This document discusses offline progressive web applications (PWAs) and their advantages. It explains how service workers allow PWAs to work reliably offline through features like caching, push notifications, and background syncing. The service worker lifecycle of registration, installation, and activation is also outlined. The document provides details on using the Cache API and intercepting requests to serve cached content when offline. It discusses how application manifests and HTTP/2 improvements can make PWAs feel like native apps and load quickly.
This presentation includes: Reflective injection using TypeScript, Reflect Metadata, Zone.js, Dependecny Injection, Angular, Decorators, Decorator Factories and etc.
Overview of zone.js (Monkey Patching, Forking, Interception). How its used in Angular for triggering Change Detection and a demo in NodeJS for authentication handling.
All my slides and demos can be found here: https://github.com/IliaIdakiev/slides
Predictable reactive state management - ngrxIlia Idakiev
This document provides an overview and introduction to Predictable Reactive State Management using NGRX. It begins with an introduction to the speaker and then outlines the schedule which includes topics like functional programming, RxJS, Angular change detection, Redux, and NGRX. It then discusses how functional programming concepts like pure functions, immutable data, and declarative programming relate to Angular and libraries like RxJS and NGRX. Specific NGRX concepts like actions, reducers, and selectors are introduced. Examples are provided for building an NGRX application with a single reducer handling the state updates. Additional resources are listed at the end.
Key AI Technologies Used by Indian Artificial Intelligence CompaniesMypcot Infotech
Indian tech firms are rapidly adopting advanced tools like machine learning, natural language processing, and computer vision to drive innovation. These key AI technologies enable smarter automation, data analysis, and decision-making. Leading developments are shaping the future of digital transformation among top artificial intelligence companies in India.
For more information please visit here https://www.mypcot.com/artificial-intelligence
Providing Better Biodiversity Through Better DataSafe Software
This session explores how FME is transforming data workflows at Ireland’s National Biodiversity Data Centre (NBDC) by eliminating manual data manipulation, incorporating machine learning, and enhancing overall efficiency. Attendees will gain insight into how NBDC is using FME to document and understand internal processes, make decision-making fully transparent, and shine a light on underlying code to improve clarity and reduce silent failures.
The presentation will also outline NBDC’s future plans for FME, including empowering staff to access and query data independently, without relying on external consultants. It will also showcase ambitions to connect to new data sources, unlock the full potential of its valuable datasets, create living atlases, and place its valuable data directly into the hands of decision-makers across Ireland—ensuring that biodiversity is not only protected but actively enhanced.
The rise of e-commerce has redefined how retailers operate—and reconciliation...Prachi Desai
As payment flows grow more fragmented, the complexity of reconciliation and revenue recognition increases. The result? Mounting operational costs, silent revenue leakages, and avoidable financial risk.
Spot the inefficiencies. Automate what’s slowing you down.
https://www.taxilla.com/ecommerce-reconciliation
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchMaxim Salnikov
Discover how Agentic Retrieval in Azure AI Search takes Retrieval-Augmented Generation (RAG) to the next level by intelligently breaking down complex queries, leveraging full conversation history, and executing parallel searches through a new LLM-powered query planner. This session introduces a cutting-edge approach that delivers significantly more accurate, relevant, and grounded answers—unlocking new capabilities for building smarter, more responsive generative AI applications.
Traditional Retrieval-Augmented Generation (RAG) pipelines work well for simple queries—but when users ask complex, multi-part questions or refer to previous conversation history, they often fall short. That’s where Agentic Retrieval comes in: a game-changing advancement in Azure AI Search that brings LLM-powered reasoning directly into the retrieval layer.
This session unveils how agentic techniques elevate your RAG-based applications by introducing intelligent query planning, subquery decomposition, parallel execution, and result merging—all orchestrated by a new Knowledge Agent. You’ll learn how this approach significantly boosts relevance, groundedness, and answer quality, especially for sophisticated enterprise use cases.
Key takeaways:
- Understand the evolution from keyword and vector search to agentic query orchestration
- See how full conversation context improves retrieval accuracy
- Explore measurable improvements in answer relevance and completeness (up to 40% gains!)
- Get hands-on guidance on integrating Agentic Retrieval with Azure AI Foundry and SDKs
- Discover how to build scalable, AI-first applications powered by this new paradigm
Whether you're building intelligent copilots, enterprise Q&A bots, or AI-driven search solutions, this session will equip you with the tools and patterns to push beyond traditional RAG.
How AI Can Improve Media Quality Testing Across Platforms (1).pptxkalichargn70th171
Media platforms, from video streaming to OTT and Smart TV apps, face unprecedented pressure to deliver seamless, high-quality experiences across diverse devices and networks. Ensuring top-notch Quality of Experience (QoE) is critical for user satisfaction and retention.
14 Years of Developing nCine - An Open Source 2D Game FrameworkAngelo Theodorou
A 14-year journey developing nCine, an open-source 2D game framework.
This talk covers its origins, the challenges of staying motivated over the long term, and the hurdles of open-sourcing a personal project while working in the game industry.
Along the way, it’s packed with juicy technical pills to whet the appetite of the most curious developers.
Invited Talk at RAISE 2025: Requirements engineering for AI-powered SoftwarE Workshop co-located with ICSE, the IEEE/ACM International Conference on Software Engineering.
Abstract: Foundation Models (FMs) have shown remarkable capabilities in various natural language tasks. However, their ability to accurately capture stakeholder requirements remains a significant challenge for using FMs for software development. This paper introduces a novel approach that leverages an FM-powered multi-agent system called AlignMind to address this issue. By having a cognitive architecture that enhances FMs with Theory-of-Mind capabilities, our approach considers the mental states and perspectives of software makers. This allows our solution to iteratively clarify the beliefs, desires, and intentions of stakeholders, translating these into a set of refined requirements and a corresponding actionable natural language workflow in the often-overlooked requirements refinement phase of software engineering, which is crucial after initial elicitation. Through a multifaceted evaluation covering 150 diverse use cases, we demonstrate that our approach can accurately capture the intents and requirements of stakeholders, articulating them as both specifications and a step-by-step plan of action. Our findings suggest that the potential for significant improvements in the software development process justifies these investments. Our work lays the groundwork for future innovation in building intent-first development environments, where software makers can seamlessly collaborate with AIs to create software that truly meets their needs.
Micro-Metrics Every Performance Engineer Should Validate Before Sign-OffTier1 app
When it comes to performance testing, most engineers instinctively gravitate toward the big-picture indicators—response time, memory usage, throughput. But what about the smaller, more subtle indicators that quietly shape your application’s performance and stability? we explored the hidden layer of performance diagnostics that too often gets overlooked: micro-metrics. These small but mighty data points can reveal early signs of trouble long before they manifest as outages or degradation in production.
From garbage collection behavior and object creation rates to thread state transitions and blocked thread patterns, we unpacked the critical micro-metrics every performance engineer should assess before giving the green light to any release.
This session went beyond the basics, offering hands-on demonstrations and JVM-level diagnostics that help identify performance blind spots traditional tests tend to miss. We showed how early detection of these subtle anomalies can drastically reduce post-deployment issues and production firefighting.
Whether you're a performance testing veteran or new to JVM tuning, this session helped shift your validation strategies left—empowering you to detect and resolve risks earlier in the lifecycle.
How to purchase, license and subscribe to Microsoft Azure_PDF.pdfvictordsane
Microsoft Azure is a cloud platform that empowers businesses with scalable computing, data analytics, artificial intelligence, and cybersecurity capabilities.
Arguably the biggest hurdle for most organizations is understanding how to get started.
Microsoft Azure is a consumption-based cloud service. This means you pay for what you use. Unlike traditional software, Azure resources (e.g., VMs, databases, storage) are billed based on usage time, storage size, data transfer, or resource configurations.
There are three primary Azure purchasing models:
• Pay-As-You-Go (PAYG): Ideal for flexibility. Billed monthly based on actual usage.
• Azure Reserved Instances (RI): Commit to 1- or 3-year terms for predictable workloads. This model offers up to 72% cost savings.
• Enterprise Agreements (EA): Best suited for large organizations needing comprehensive Azure solutions and custom pricing.
Licensing Azure: What You Need to Know
Azure doesn’t follow the traditional “per seat” licensing model. Instead, you pay for:
• Compute Hours (e.g., Virtual Machines)
• Storage Used (e.g., Blob, File, Disk)
• Database Transactions
• Data Transfer (Outbound)
Purchasing and subscribing to Microsoft Azure is more than a transactional step, it’s a strategic move.
Get in touch with our team of licensing experts via [email protected] to further understand the purchasing paths, licensing options, and cost management tools, to optimize your investment.
Boost Student Engagement with Smart Attendance Software for SchoolsVisitu
Boosting student engagement is crucial for educational success, and smart attendance software is a powerful tool in achieving that goal. Read the doc to know more.
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentricNatan Silnitsky
At Wix, we revolutionized our platform by making integration events the backbone of our 4,000-microservice ecosystem. By abandoning traditional domain events for standardized Protobuf events through Kafka, we created a universal language powering our entire architecture.
We'll share how our "single-aggregate services" approach—where every CUD operation triggers semantic events—transformed scalability and extensibility, driving efficient event choreography, data lake ingestion, and search indexing.
We'll address our challenges: balancing consistency with modularity, managing event overhead, and solving consumer lag issues. Learn how event-based data prefetches dramatically improved performance while preserving the decoupling that makes our platform infinitely extensible.
Key Takeaways:
- How integration events enabled unprecedented scale and extensibility
- Practical strategies for event-based data prefetching that supercharge performance
- Solutions to common event-driven architecture challenges
- When to break conventional architectural rules for specific contexts
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesMarjukka Niinioja
Teams delivering API are challenges with:
- Connecting APIs to business strategy
- Measuring API success (audit & lifecycle metrics)
- Partner/Ecosystem onboarding
- Consistent documentation, security, and publishing
🧠 The big takeaway?
Many teams can build APIs. But few connect them to value, visibility, and long-term improvement.
That’s why the APIOps Cycles method helps teams:
📍 Start where the pain is (one “metro station” at a time)
📈 Scale success across strategy, platform, and operations
🛠 Use collaborative canvases to get buy-in and visibility
Want to try it and learn more?
- Follow APIOps Cycles in LinkedIn
- Visit the www.apiopscycles.com site
- Subscribe to email list
-
Alt-lenders are scaling fast, but manual loan reconciliation is cracking under pressure. See how automation solves revenue leakage and compliance chaos.
https://www.taxilla.com/loan-repayment-reconciliation
Best Inbound Call Tracking Software for Small BusinessesTheTelephony
The best inbound call tracking software for small businesses offers features like call recording, real-time analytics, lead attribution, and CRM integration. It helps track marketing campaign performance, improve customer service, and manage leads efficiently. Look for solutions with user-friendly dashboards, customizable reporting, and scalable pricing plans tailored for small teams. Choosing the right tool can significantly enhance communication and boost overall business growth.
2. A B O U T M E
{
"name": "Ilia Idakiev",
"experience": [
"Developer & Founder of HNS/HG“,
"Lecturer in 'Advanced JS' @ Sofia University”,
"Contractor / Consultant",
“Public / Private Courses“
],
"involvedIn": [
"SofiaJS", "BeerJS", "Angular Sofia"
]
}
4. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
SEPARATION OF CONCERNS (SOC)
▸ Design principle for separating a computer program into distinct sections, such
that each section addresses a separate concern. (Modularity)
5. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
S.O.L.I.D PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING
▸ Single Responsibility Principle
▸ Open / Close Principle
▸ Liskov Substitution Principle
▸ Interface Segregation Principle
▸ Dependency Inversion Principle
http://aspiringcraftsman.com/2011/12/08/solid-javascript-single-responsibility-principle/
6. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
MODE - VIEW - CONTROLLER
▸ MODEL - the central component of the pattern. It
is the application's dynamic data structure,
independent of the user interface. It directly
manages the data, logic and rules of the
application.
▸ VIEW - any output representation of information.
▸ CONTROLLER - accepts input and converts it to
commands for the model.
7. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
WEB COMPONENTS
▸ Introduced by Alex Russell (Chrome team @ Google)
at Fronteers Conference 2011
▸ A set of features currently being added by the W3C to
the HTML and DOM specifications that allow the creation of
reusable widgets or components in web documents and web applications.
▸ The intention behind them is to bring component-based software
engineering to the World Wide Web.
8. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
WEB COMPONENTS FEATURES:
▸ HTML Templates - an HTML fragment is not rendered, but stored until it is
instantiated via JavaScript.
▸ Shadow DOM - Encapsulated DOM and styling, with composition.
▸ Custom Elements - APIs to define new HTML elements.
▸ HTML Imports - Declarative methods of importing HTML documents into other
documents. (Replaced by ES6 Imports).
10. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
DEFINE CUSTOM ELEMENT
(function () {
const template = createTemplate('<div>Hello World<div>');
class Counter extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
}
}
customElements.define('hg-counter', Counter);
}());
Create an isolated scope
counter.js
11. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
(function () {
const template = createTemplate('<div>Hello World<div>');
class Counter extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
}
}
customElements.define('hg-counter', Counter);
}());
DEFINE CUSTOM ELEMENT Create a new class that extends HTMLElement
counter.js
12. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
(function () {
const template = createTemplate('<div>Hello World<div>');
class Counter extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
}
}
customElements.define('hg-counter', Counter);
}());
DEFINE CUSTOM ELEMENT Register the new custom element.
counter.js
13. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
HTML TEMPLATES
▸ The <template> tag holds its content hidden from the client.
▸ Content inside a <template> tag will be parsed but not rendered.
▸ The content can be visible and rendered later by using JavaScript.
14. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
WAYS TO CREATE A TEMPLATE
<template id="template">
<h2>Hello World</h2>
</template>
const template =
document.createElement('template');
template.innerHTML =
'<h2>Hello World</h2>';
Using HTML Using JavaScript
15. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
CREATE TEMPLATE HELPER FUNCTION
function createTemplate(string) {
const template = document.createElement('template');
template.innerHTML = string;
return template;
}
utils.js
16. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
CREATE THE TEMPLATE
(function () {
const template = createTemplate('<div>Hello World<div>');
class Counter extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
}
}
customElements.define('hg-counter', Counter);
}());
Use the create template helper function.
counter.js
17. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
SHADOW DOM
▸ Isolated DOM - The component's DOM is self-contained
(e.g. document.querySelector() won't return nodes in the component's shadow DOM).
▸ Scoped CSS - CSS defined inside shadow DOM is scoped to it. Style rules
don't leak out and page styles don't bleed in.
▸ Composition - done with the <slot> element.
(Slots are placeholders inside your component that users can fill with their own markup).
18. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
DEFINE CUSTOM ELEMENT
(function () {
const template = createTemplate('<div>Hello World<div>');
class Counter extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
}
}
customElements.define('hg-counter', Counter);
}());
counter.js
Utilise the class constructor.
19. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ATTACH SHADOW DOM
(function () {
const template = createTemplate('<div>Hello World<div>');
class Counter extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
}
}
customElements.define('hg-counter', Counter);
}());
Attach the shadow DOM.
counter.js
20. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
(function () {
const template = createTemplate('<div>Hello World<div>');
class Counter extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
}
}
customElements.define('hg-counter', Counter);
}());
CREATE THE TEMPLATE Attach the template contents to the shadow root.
counter.js
21. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
USE OUR CUSTOM ELEMENT
<body>
<hg-counter></hg-counter>
<script src="./util.js"></script>
<script src="./counter.js"></script>
</body>
index.html
22. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
EXTEND OUR CUSTOM ELEMENT
index.html
(function () {
const template = createTemplate(`
<div name="value"></div>
<button data-type=“dec">-</button>
<button data-type="inc">+</button>
`);
class Counter extends HTMLElement {
constructor() {
super();
23. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
EXTEND OUR CUSTOM ELEMENT
index.html
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
shadowRoot.addEventListener('click', ({ target }) => {
const type = target.getAttribute('data-type');
if (type === 'dec') {
this.counter--;
} else if (type === 'inc') {
this.counter++;
}
});
24. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
EXTEND OUR CUSTOM ELEMENT
index.html
class Counter extends HTMLElement {
set counter(value) {
this._counter = value;
}
get counter() {
return this._counter;
}
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
this.counter = 0;
25. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
UPDATING THE DOM
utils.js
function updateDOM(root, updates) {
updates.forEach(item => {
root.querySelectorAll(`[name=${item.name}]`).forEach(element =>
element.textContent = item.value
);
});
}
26. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
EXTEND OUR CUSTOM ELEMENT
index.html
class Counter extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
this.counter = 0;
this._update = () => {
updateDOM(shadowRoot, [{
name: 'value',
value: this.counter
}]);
}
27. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
EXTEND OUR CUSTOM ELEMENT
index.html
class Counter extends HTMLElement {
set counter(value) {
this._counter = value;
this._update();
}
get counter() {
return this._counter;
}
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.appendChild(template.content.cloneNode(true));
this.counter = 0;
28. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
CUSTOM COMPONENT ATTRIBUTES
index.html
<body>
<hg-counter value="10"></hg-counter>
<script src="./util.js"></script>
<script src="./counter.js"></script>
</body>
29. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
CUSTOM ELEMENTS LIFECYCLE CALLBACKS
▸ connectedCallback - Invoked each time the custom element is appended into a
document-connected element. This will happen each time the node is moved, and
may happen before the element's contents have been fully parsed.
▸ disconnectedCallback - Invoked each time the custom element is disconnected
from the document's DOM.
▸ attributeChangedCallback - Invoked each time one of the custom element's
attributes is added, removed, or changed.
▸ adoptedCallback - Invoked each time the custom element is moved to a new
document.
30. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
CUSTOM COMPONENT ATTRIBUTES
index.html
class Counter extends HTMLElement {
static get observedAttributes() {
return ['value'];
}
attributeChangedCallback(name, oldValue, newValue) {
if (name === 'value') {
this.counter = newValue;
}
}
constructor() {
Handle attribute changes
31. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
CUSTOM COMPONENT ATTRIBUTES
index.html
class Counter extends HTMLElement {
static get observedAttributes() {
return ['value'];
}
attributeChangedCallback(name, oldValue, newValue) {
if (name === 'value') {
this.counter = newValue;
}
}
constructor() {
Define which attributes should be watched
33. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
CUSTOM COMPONENT STYLES
index.html
Apply scoped styles to our component
(function () {
const template = createTemplate(`
<style>
:host {
display: flex;
}
div[name="value"] {
min-width: 30px;
}
</style>
<div name="value"></div>
<button data-type="dec">-</button>
<button data-type="inc">+</button>
`);
class Counter extends HTMLElement {
34. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
FURTHER READING
▸ Extending different HTML Elements
(e.g. HTMLButton)
▸ Dispatching Custom Events
35. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
BENEFITS OF USING CUSTOM COMPONENTS
▸ Framework agnostic - Written in JavaScript and native to the browser.
▸ Simplifies CSS - Scoped DOM means you can use simple CSS selectors, more
generic id/class names, and not worry about naming conflicts.
• Productivity - Think of apps in chunks of DOM rather than one large (global) page.
▸ Productivity - Think of apps in chunks of DOM rather than one large (global)
page.
37. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
COSTS OF USING CUSTOM COMPONENTS
▸ Template Generation - manually construct the DOM for our templates
(No JSX features or Structural Directives)
▸ DOM Updates - manually track and handle changes to our DOM
(No Virtual DOM or Change Detection)
38. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
LIT HTML
▸ Library Developed by the Polymer Team @ GOOGLE
▸ Efficient - lit-html is extremely fast. It uses fast platform features like
HTML <template> elements with native cloning.
▸ Expressive - lit-html gives you the full power of JavaScript and functional programming
patterns.
▸ Extensible - Different dialects of templates can be created with additional features for setting
element properties, declarative event handlers and more.
▸ It can be used standalone for simple tasks, or combined with a framework or component model,
like Web Components, for a full-featured UI development platform.
▸ It has an awesome VSC extension for syntax highlighting and formatting.
39. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
FRAMEWORKS
▸ StencilJS - a simple library for generating Web Components and
progressive web apps (PWA).
(built by the Ionic Framework team for its next generation of performant mobile and desktop Web
Components)
▸ Polymer - library for creating web components.
(built by Google and used by YouTube, Netflix, Google Earth and others)
▸ SkateJS - library providing functional abstraction over web
components.
▸ Angular Elements
40. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
WEB COMPONENTS SERVER SIDE RENDERING
▸ Rendertron - Rendertron is a headless Chrome rendering solution
designed to render & serialise web pages on the fly.
▸ SkateJS SSR - @skatejs/ssr is a web component server-side
rendering and testing library.
42. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS
▸ A part of Angular Labs set.
▸ Angular elements are Angular components
packaged as Custom Elements.
43. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS
▸ Angular’s createCustomElement() function transforms an Angular component,
together with its dependencies, to a class that is configured to produce a self-
bootstrapping instance of the component.
▸ It transforms the property names to make them compatible with custom
elements.
▸ Component outputs are dispatched as HTML Custom Events, with the name
of the custom event matching the output name.
▸ Then customElements.define() is used to register our custom element.
Transformation
45. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
NEW ANGULAR PROJECT
ng new angular-elements // Create new Angular CLI project
cd angular-elements
ng add @angular/elements // Add angular elements package
ng g c counter // Generate a new component
// Navigate to our new project
46. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS The generated component
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.css'],
encapsulation: ViewEncapsulation.Native
})
export class CounterComponent {
@Input() counter = 0;
constructor() { }
inc() { this.counter++; }
dec() { this.counter--; }
}
src/app/counter/counter.component.ts
47. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Add View Encapsulation via Shadow DOM (Native)
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.css'],
encapsulation: ViewEncapsulation.Native
})
export class CounterComponent {
@Input() counter = 0;
constructor() { }
inc() { this.counter++; }
dec() { this.counter--; }
}
src/app/counter/counter.component.ts
48. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create a counter input property
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.css'],
encapsulation: ViewEncapsulation.Native
})
export class CounterComponent {
@Input() counter = 0;
constructor() { }
inc() { this.counter++; }
dec() { this.counter--; }
}
src/app/counter/counter.component.ts
49. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create counter handlers
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.css'],
encapsulation: ViewEncapsulation.Native
})
export class CounterComponent {
@Input() counter = 0;
constructor() { }
inc() { this.counter++; }
dec() { this.counter--; }
}
src/app/counter/counter.component.ts
50. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Present the counter value
<div>{{counter}}</div>
<button (click)="dec()">Dec</button>
<button (click)="inc()">Inc</button>
src/app/counter/counter.component.html
51. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create the manipulation buttons and connect the to the handlers
<div>{{counter}}</div>
<button (click)="dec()">Dec</button>
<button (click)="inc()">Inc</button>
src/app/counter/counter.component.html
54. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
NEW ANGULAR MODULE
ng g m counter // Create new counter module
55. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create a module for out custom elements
@NgModule({
imports: [
BrowserModule
],
declarations: [],
entryComponents: [CounterComponent]
})
export class CounterModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(CounterComponent, { injector: this.injector });
customElements.define('app-counter', el);
}
}
src/app/counter/counter.module.ts
56. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create a module for out custom elements
@NgModule({
imports: [
BrowserModule
],
declarations: [CounterComponent],
entryComponents: [CounterComponent]
})
export class CounterModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(CounterComponent, { injector: this.injector });
customElements.define('app-counter', el);
}
}
src/app/counter/counter.module.ts
57. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create a module for out custom elements
@NgModule({
imports: [
BrowserModule
],
declarations: [CounterComponent],
entryComponents: [CounterComponent]
})
export class CounterModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(CounterComponent, { injector: this.injector });
customElements.define('app-counter', el);
}
}
src/app/counter/counter.module.ts
58. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create a module for out custom elements
@NgModule({
imports: [
BrowserModule
],
declarations: [CounterComponent],
entryComponents: [CounterComponent]
})
export class CounterModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(CounterComponent, { injector: this.injector });
customElements.define('app-counter', el);
}
}
src/app/counter/counter.module.ts
59. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create a module for out custom elements
@NgModule({
imports: [
BrowserModule
],
declarations: [CounterComponent],
entryComponents: [CounterComponent]
})
export class CounterModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(CounterComponent, { injector: this.injector });
customElements.define('app-counter', el);
}
}
src/app/counter/counter.module.ts
60. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create a module for out custom elements
@NgModule({
imports: [
BrowserModule
],
declarations: [CounterComponent],
entryComponents: [CounterComponent]
})
export class CounterModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(CounterComponent, { injector: this.injector });
customElements.define('app-counter', el);
}
}
src/app/counter/counter.module.ts
61. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Create a module for out custom elements
@NgModule({
imports: [
BrowserModule
],
declarations: [CounterComponent],
entryComponents: [CounterComponent]
})
export class CounterModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(CounterComponent, { injector: this.injector });
customElements.define('app-counter', el);
}
}
src/app/counter/counter.module.ts
63. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
IVY - THE NEW RENDERING ENGINE FOR ANGULAR
▸ Monomorphic (Fast) - All internal data structures are monomorphic.
▸ Tree Shaking (Efficient) - removing unused pieces of code from our
applications.
https://github.com/angular/angular/blob/master/packages/compiler/design/architecture.md
64. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ANGULAR ELEMENTS Using the Ivy hopefully we will have something like:
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.css'],
customElement: true
})
export class CounterComponent {
@Input() counter = 0;
constructor() { }
inc() { this.counter++; }
dec() { this.counter--; }
}
src/app/counter/counter.component.ts
65. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
FAQ
▸ Can we use Dependency Injection?
▸ What about Content Projection?
▸ Can we still use Slots?
66. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
BENEFITS OF USING ANGULAR ELEMENTS
▸ All components can be reused across JavaScript applications.
▸ Creating Dynamic Components.
▸ Hybrid Rendering - Server Side Rendering with Custom Elements that don’t
wait for the application to bootstrap to start working.
▸ Micro Frontends Architecture - Vertical Application Scaling (Working with
multiple small applications instead of a big monolith.)
https://micro-frontends.org
67. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
ADDITIONAL RESOURCES
▸ https://custom-elements-everywhere.com - This project runs a suite of tests
against each framework to identify interoperability issues, and highlight
potential fixes already implemented in other frameworks.
68. BUILDING REUSABLE CUSTOM ELEMENTS USING ANGULAR
CONNECT
GitHub > https://github.com/iliaidakiev (/slides/ - list of future and past events)
Twitter > @ilia_idakiev