This document discusses how to create and reuse messages in AngularJS using the ngMessages directive. It describes how ngMessages allows including generic message templates that can be overridden locally, and how to control the visibility of messages using structural directives like ngIf. It also covers how to add animations to messages using ngAnimate, including both CSS transitions and JavaScript animations. Key points covered include reusing messages across an app, overriding template messages locally, and triggering animations on message add/removal.
The document discusses local versus global variables in JavaScript, noting that declaring variables with var makes them local and available only within the function, while declaring without var makes them global and available outside the function. It provides examples showing how local and global variables work differently depending on whether var is used or not when declaring the variable. The document aims to explain the difference between local and global variables and when it is better to use local variables over global ones.
This document provides an introduction to JavaScript events through examples. It demonstrates how mouseover and mouseout events can be used to display alerts and change images. It also shows how onclick events can alter background colors and call prompts. The document discusses using the document and window objects to manipulate page elements from JavaScript code embedded in HTML tags.
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference ZürichRobert Nyman
The document discusses HTML5 and CSS3 features for mobile development, including CSS media queries, flexbox, transitions, animations, and new HTML5 form elements. It also covers JavaScript techniques like geolocation, web storage, offline applications, and the history API. Additional topics include mobile performance optimization, debugging with Weinre, and link protocols.
Blockly is a visual programming editor used to generate HTML and JavaScript code. The document describes the development of Blockly blocks for creating a basic WebGL page. Blockly blocks were created for elements of an HTML page like the header, title, body, and canvas. Additional blocks generate JavaScript code for drawing shapes on the canvas using WebGL including lines, setting line styles, and line caps. The full HTML and JavaScript code for a simple WebGL page can be generated by connecting the various Blockly blocks.
This document contains slides from a presentation on relational databases and MySQL. It introduces key concepts like tables, rows, columns and relationships. It also covers SQL statements for querying, manipulating and administering databases including SELECT, INSERT, UPDATE, DELETE and JOIN. Examples are provided to illustrate database structure and performing queries on single and multiple tables.
The document discusses Angular form validation including:
1. Angular provides properties like $valid, $invalid, $pristine, $dirty to validate forms and inputs.
2. Rules can be set using attributes like required, minlength, maxlength on inputs.
3. Error messages can be conditionally displayed using ng-show and properties.
4. Classes like ng-valid and ng-invalid allow styling based on validation state.
5. The form can be conditionally submitted based on its validity.
Angular js form validation with ngmessages shashi-19-7-16Shashikant Bhongale
NgMessages is an AngularJS module that helps manage form validation error messages. It allows displaying the appropriate error message for each type of validation error. With ngMessages, error messages can be defined in a reusable way in an external template rather than directly in the form. It also only displays messages after the user has interacted with the form field to improve the user experience. The module works by checking the $error property on form fields and selectively displaying error messages using ng-message directives.
The document discusses local versus global variables in JavaScript, noting that declaring variables with var makes them local and available only within the function, while declaring without var makes them global and available outside the function. It provides examples showing how local and global variables work differently depending on whether var is used or not when declaring the variable. The document aims to explain the difference between local and global variables and when it is better to use local variables over global ones.
This document provides an introduction to JavaScript events through examples. It demonstrates how mouseover and mouseout events can be used to display alerts and change images. It also shows how onclick events can alter background colors and call prompts. The document discusses using the document and window objects to manipulate page elements from JavaScript code embedded in HTML tags.
HTML5 and CSS3 – exploring mobile possibilities - Frontend Conference ZürichRobert Nyman
The document discusses HTML5 and CSS3 features for mobile development, including CSS media queries, flexbox, transitions, animations, and new HTML5 form elements. It also covers JavaScript techniques like geolocation, web storage, offline applications, and the history API. Additional topics include mobile performance optimization, debugging with Weinre, and link protocols.
Blockly is a visual programming editor used to generate HTML and JavaScript code. The document describes the development of Blockly blocks for creating a basic WebGL page. Blockly blocks were created for elements of an HTML page like the header, title, body, and canvas. Additional blocks generate JavaScript code for drawing shapes on the canvas using WebGL including lines, setting line styles, and line caps. The full HTML and JavaScript code for a simple WebGL page can be generated by connecting the various Blockly blocks.
This document contains slides from a presentation on relational databases and MySQL. It introduces key concepts like tables, rows, columns and relationships. It also covers SQL statements for querying, manipulating and administering databases including SELECT, INSERT, UPDATE, DELETE and JOIN. Examples are provided to illustrate database structure and performing queries on single and multiple tables.
The document discusses Angular form validation including:
1. Angular provides properties like $valid, $invalid, $pristine, $dirty to validate forms and inputs.
2. Rules can be set using attributes like required, minlength, maxlength on inputs.
3. Error messages can be conditionally displayed using ng-show and properties.
4. Classes like ng-valid and ng-invalid allow styling based on validation state.
5. The form can be conditionally submitted based on its validity.
Angular js form validation with ngmessages shashi-19-7-16Shashikant Bhongale
NgMessages is an AngularJS module that helps manage form validation error messages. It allows displaying the appropriate error message for each type of validation error. With ngMessages, error messages can be defined in a reusable way in an external template rather than directly in the form. It also only displays messages after the user has interacted with the form field to improve the user experience. The module works by checking the $error property on form fields and selectively displaying error messages using ng-message directives.
George Cooper is a US attorney who has worked extensively in Cambodia since 2002, currently as a senior attorney for two non-profit organizations advocating for land rights and natural resources on behalf of Cambodians. He has held various legal and advisory roles in Cambodia related to land rights, indigenous land titling, and assisting the poor. Prior to working in Cambodia, Cooper worked as an attorney in Hawaii from 1979-1995, where he represented communities on environmental and tenants' rights cases. He has authored publications on land rights and corruption in Hawaii.
The candidate is applying for a suitable position that allows growth and makes use of his teamwork, organization, and work ethic skills. He has over 5 years of professional experience in photography, management, security, and apprentice-level trades. This includes current roles as a photo journalist, general manager, and security officer. The candidate also lists education in sound recording and music production as well as emergency medical technician training. He provides two references and encourages contacting him to further discuss his qualifications which also include skills as a rapper, songwriter, and performer.
Este documento proporciona instrucciones sobre cómo participar en foros de Moodle. Explica cómo ver el contenido de un foro, incluidos los temas y mensajes. También describe cómo crear nuevos temas de foro escribiendo un asunto y mensaje, y cómo responder a mensajes existentes. El objetivo es facilitar la discusión y el intercambio de información entre los miembros del grupo.
El documento resume la lectura del libro Bajo la misma estrella de John Green. Contiene varias frases clave del libro que resumen la historia de amor entre los protagonistas y la enfermedad que enfrentan. El autor del documento disfrutó la rebelión y superación de los personajes así como la trama impredecible del libro, y recomienda la lectura porque captura la vida real de una manera maravillosa.
Interview with Delaware North CMO Todd MerryJared Frank
1) Delaware North undertook the research exercise to look specifically at how emerging technologies might affect their sports industry and share the findings with clients to help inform decision making.
2) The 2016 version of the research was similar to 2015 in examining fast-changing technology trends, but updated areas like esports that had evolved significantly in just one year.
3) Todd Merry expects they will produce a third version to continue providing regular updates, as the world is moving quickly and technology is changing rapidly.
The document discusses the view layer in eZ Platform, which wraps Symfony's MVC layer and renders content using templates and controllers. It describes changes in eZ Platform 1.x including deprecation of location_view and custom controllers no longer needing to inherit from a built-in class. It also covers query types, which are query factories that support parameters, and the query controller, which runs queries and assigns results to views. Finally, it discusses how to create custom views using value objects, view objects, view builders, and optional view configuration.
Pasien mengalami luka parah akibat kecelakaan. Istrinya meminta agar antibiotik dihentikan karena kondisi pasien semakin memburuk dan tidak akan bisa pulih seperti semula. Keputusan untuk menghentikan pengobatan membutuhkan pertimbangan etis yang matang.
This document proposes a research study on customer loyalty within the retail sector. The study will use both secondary and primary research to explore the factors that influence customer loyalty for fast moving consumer goods. A survey and interviews will be conducted to understand customer purchase patterns, attitudes, and perceptions regarding brand loyalty. The research aims to identify the key determinants of customer loyalty and how it can be measured and improved within the retail context.
Krisis Krimea mengakibatkan penyatuan kembali wilayah tersebut dengan Rusia setelah referendum yang menunjukkan dukungan mayoritas penduduk. Krisis ini bermula dari revolusi Ukraina 2014 yang menggulingkan pemerintah pro-Rusia dan meningkatkan ketegangan antara kelompok pro-Eropa dan pro-Rusia. Rusia kemudian secara diam-diam mengerahkan pasukannya ke Krimea untuk mendukung pemisahan diri wilayah tersebut dari
Shared Security Responsibility Model of AWSAkshay Mathur
I heard many people saying that they need not worry about security of their application (or it is automatically PCI compliant) just because the application is hosted in AWS EC2.
This was presented in AWS meetup to make it clear to audience that security is shared responsibility. While AWS takes care of security at L1 & L2 and provide tools for L3 & L4, we need to take care of security at L7 (Application layer)
Editar la configuración del perfil de participantes, ver listado de participantes y enviar mensajes mediante el servicio de mensajería interna de la plataforma de moodle.
This internship summary provides an overview of an internship at a structural design firm. The internship objectives were to become familiar with the workflow of structural design, bridge the gap between academic and industrial knowledge, and understand real-world design assumptions. The intern performed tasks like analyzing and designing structural elements manually and using software, modeled projects in ETABS, and assisted with drafting detailing drawings. Overall, the internship provided both technical skills in structural design and analysis and non-technical skills such as teamwork, communication, and time management.
Permen no.19 th_2016 ttg pedoman pengelolaan barang milik daerahUlfah Hanum
Peraturan Menteri Dalam Negeri ini mengatur tentang pedoman pengelolaan barang milik daerah. Ruang lingkupnya meliputi pejabat pengelola barang milik daerah, perencanaan kebutuhan dan penganggaran, pengadaan, penggunaan, pemanfaatan, pengamanan dan pemeliharaan, penilaian, pemindahtanganan, pemusnahan.
This document provides an overview of Sitecore Experience Platform analytics, Web Forms for Marketers (WFFM), and Email Experience Manager (EXM). It discusses how analytics data flows from MongoDB to SQL databases and how to configure and set up MongoDB, WFFM, and EXM. The document also previews demonstrating the functionality of WFFM and EXM, including creating forms and emails.
Miguel de Cervantes' first book, La Galatea, was published in 1585. It examines love through the stories of pastoral characters and references contemporary literary figures. Though it enjoyed modest success, it was not reprinted and the planned sequel was never published. The story follows the shepherd Elicio who loves the shepherdess Galatea but her father wants her to marry the rich shepherd Erastro. Elicio tries to prevent this marriage from happening. The work contains additional minor stories and is set along the shores of the Tagus River in Portugal.
Miguel de Cervantes was a Spanish soldier, novelist, poet and playwright born in 1547. His first novel, La Galatea, published in 1585 is considered a pastoral romance and shows his early interest in poetry. The main characters are shepherds Elicio and Erastro who are in love with Galatea and discuss their troubles in a poetic style. The majority of characters are involved in minor storylines that sometimes intersect. The plot involves various stories of love and romance between the characters that are resolved through poetry competitions and duels.
Innovations in the field of technology are happening in lightning speed. It is more out of necessity than for the sake of it that companies come up with new ideas and introduce novelties in their products and services in such a competitive market. It is but natural that better software is required to come up with such innovations according to the varied needs of this evolving market, that too faster than ever. Many companies make use of Agile Software Development methods to keep up with this technological competition and challenge.Cloud computing enhances Agile Software Development in many ways. A few are listed below and learn more from our blog: http://suyati.com/how-cloud-enhances-agile-software-development
To know more about our expertise and capabilities in Agile and Cloud, please send an e-mail to services@suyati.com.
Angular Js Get Started - Complete CourseEPAM Systems
This document provides an introduction and overview of AngularJS, including:
- AngularJS is a JavaScript framework for building dynamic web applications and sites. It allows building applications that run in web browsers using HTML.
- Key AngularJS concepts covered include directives, controllers, modules, services, filters, forms, routing and two-way data binding.
- Examples are provided to demonstrate how to create AngularJS applications, controllers, directives, filters and more.
- Custom directives and services can be created to extend the functionality of AngularJS applications.
This document provides instructions for using CSS overrides to create customized landing pages in a template-based CMS like Sitecore. It introduces a framework called custom-lp.css that defines classes to structure landing page content without constraints from templates. Styles, HTML and text can be added directly in the editor. The framework is responsive, with styles for desktop, tablet and mobile. Tips are provided for common issues like inline-block gaps, column width bugs, and stubborn style overrides.
A university lecture for journalism students -- how to use the canvas element to add graphics and animation to Web pages. Updated April 2014. Basics for beginners. See also https://github.com/macloo/canvas
George Cooper is a US attorney who has worked extensively in Cambodia since 2002, currently as a senior attorney for two non-profit organizations advocating for land rights and natural resources on behalf of Cambodians. He has held various legal and advisory roles in Cambodia related to land rights, indigenous land titling, and assisting the poor. Prior to working in Cambodia, Cooper worked as an attorney in Hawaii from 1979-1995, where he represented communities on environmental and tenants' rights cases. He has authored publications on land rights and corruption in Hawaii.
The candidate is applying for a suitable position that allows growth and makes use of his teamwork, organization, and work ethic skills. He has over 5 years of professional experience in photography, management, security, and apprentice-level trades. This includes current roles as a photo journalist, general manager, and security officer. The candidate also lists education in sound recording and music production as well as emergency medical technician training. He provides two references and encourages contacting him to further discuss his qualifications which also include skills as a rapper, songwriter, and performer.
Este documento proporciona instrucciones sobre cómo participar en foros de Moodle. Explica cómo ver el contenido de un foro, incluidos los temas y mensajes. También describe cómo crear nuevos temas de foro escribiendo un asunto y mensaje, y cómo responder a mensajes existentes. El objetivo es facilitar la discusión y el intercambio de información entre los miembros del grupo.
El documento resume la lectura del libro Bajo la misma estrella de John Green. Contiene varias frases clave del libro que resumen la historia de amor entre los protagonistas y la enfermedad que enfrentan. El autor del documento disfrutó la rebelión y superación de los personajes así como la trama impredecible del libro, y recomienda la lectura porque captura la vida real de una manera maravillosa.
Interview with Delaware North CMO Todd MerryJared Frank
1) Delaware North undertook the research exercise to look specifically at how emerging technologies might affect their sports industry and share the findings with clients to help inform decision making.
2) The 2016 version of the research was similar to 2015 in examining fast-changing technology trends, but updated areas like esports that had evolved significantly in just one year.
3) Todd Merry expects they will produce a third version to continue providing regular updates, as the world is moving quickly and technology is changing rapidly.
The document discusses the view layer in eZ Platform, which wraps Symfony's MVC layer and renders content using templates and controllers. It describes changes in eZ Platform 1.x including deprecation of location_view and custom controllers no longer needing to inherit from a built-in class. It also covers query types, which are query factories that support parameters, and the query controller, which runs queries and assigns results to views. Finally, it discusses how to create custom views using value objects, view objects, view builders, and optional view configuration.
Pasien mengalami luka parah akibat kecelakaan. Istrinya meminta agar antibiotik dihentikan karena kondisi pasien semakin memburuk dan tidak akan bisa pulih seperti semula. Keputusan untuk menghentikan pengobatan membutuhkan pertimbangan etis yang matang.
This document proposes a research study on customer loyalty within the retail sector. The study will use both secondary and primary research to explore the factors that influence customer loyalty for fast moving consumer goods. A survey and interviews will be conducted to understand customer purchase patterns, attitudes, and perceptions regarding brand loyalty. The research aims to identify the key determinants of customer loyalty and how it can be measured and improved within the retail context.
Krisis Krimea mengakibatkan penyatuan kembali wilayah tersebut dengan Rusia setelah referendum yang menunjukkan dukungan mayoritas penduduk. Krisis ini bermula dari revolusi Ukraina 2014 yang menggulingkan pemerintah pro-Rusia dan meningkatkan ketegangan antara kelompok pro-Eropa dan pro-Rusia. Rusia kemudian secara diam-diam mengerahkan pasukannya ke Krimea untuk mendukung pemisahan diri wilayah tersebut dari
Shared Security Responsibility Model of AWSAkshay Mathur
I heard many people saying that they need not worry about security of their application (or it is automatically PCI compliant) just because the application is hosted in AWS EC2.
This was presented in AWS meetup to make it clear to audience that security is shared responsibility. While AWS takes care of security at L1 & L2 and provide tools for L3 & L4, we need to take care of security at L7 (Application layer)
Editar la configuración del perfil de participantes, ver listado de participantes y enviar mensajes mediante el servicio de mensajería interna de la plataforma de moodle.
This internship summary provides an overview of an internship at a structural design firm. The internship objectives were to become familiar with the workflow of structural design, bridge the gap between academic and industrial knowledge, and understand real-world design assumptions. The intern performed tasks like analyzing and designing structural elements manually and using software, modeled projects in ETABS, and assisted with drafting detailing drawings. Overall, the internship provided both technical skills in structural design and analysis and non-technical skills such as teamwork, communication, and time management.
Permen no.19 th_2016 ttg pedoman pengelolaan barang milik daerahUlfah Hanum
Peraturan Menteri Dalam Negeri ini mengatur tentang pedoman pengelolaan barang milik daerah. Ruang lingkupnya meliputi pejabat pengelola barang milik daerah, perencanaan kebutuhan dan penganggaran, pengadaan, penggunaan, pemanfaatan, pengamanan dan pemeliharaan, penilaian, pemindahtanganan, pemusnahan.
This document provides an overview of Sitecore Experience Platform analytics, Web Forms for Marketers (WFFM), and Email Experience Manager (EXM). It discusses how analytics data flows from MongoDB to SQL databases and how to configure and set up MongoDB, WFFM, and EXM. The document also previews demonstrating the functionality of WFFM and EXM, including creating forms and emails.
Miguel de Cervantes' first book, La Galatea, was published in 1585. It examines love through the stories of pastoral characters and references contemporary literary figures. Though it enjoyed modest success, it was not reprinted and the planned sequel was never published. The story follows the shepherd Elicio who loves the shepherdess Galatea but her father wants her to marry the rich shepherd Erastro. Elicio tries to prevent this marriage from happening. The work contains additional minor stories and is set along the shores of the Tagus River in Portugal.
Miguel de Cervantes was a Spanish soldier, novelist, poet and playwright born in 1547. His first novel, La Galatea, published in 1585 is considered a pastoral romance and shows his early interest in poetry. The main characters are shepherds Elicio and Erastro who are in love with Galatea and discuss their troubles in a poetic style. The majority of characters are involved in minor storylines that sometimes intersect. The plot involves various stories of love and romance between the characters that are resolved through poetry competitions and duels.
Innovations in the field of technology are happening in lightning speed. It is more out of necessity than for the sake of it that companies come up with new ideas and introduce novelties in their products and services in such a competitive market. It is but natural that better software is required to come up with such innovations according to the varied needs of this evolving market, that too faster than ever. Many companies make use of Agile Software Development methods to keep up with this technological competition and challenge.Cloud computing enhances Agile Software Development in many ways. A few are listed below and learn more from our blog: http://suyati.com/how-cloud-enhances-agile-software-development
To know more about our expertise and capabilities in Agile and Cloud, please send an e-mail to services@suyati.com.
Angular Js Get Started - Complete CourseEPAM Systems
This document provides an introduction and overview of AngularJS, including:
- AngularJS is a JavaScript framework for building dynamic web applications and sites. It allows building applications that run in web browsers using HTML.
- Key AngularJS concepts covered include directives, controllers, modules, services, filters, forms, routing and two-way data binding.
- Examples are provided to demonstrate how to create AngularJS applications, controllers, directives, filters and more.
- Custom directives and services can be created to extend the functionality of AngularJS applications.
This document provides instructions for using CSS overrides to create customized landing pages in a template-based CMS like Sitecore. It introduces a framework called custom-lp.css that defines classes to structure landing page content without constraints from templates. Styles, HTML and text can be added directly in the editor. The framework is responsive, with styles for desktop, tablet and mobile. Tips are provided for common issues like inline-block gaps, column width bugs, and stubborn style overrides.
A university lecture for journalism students -- how to use the canvas element to add graphics and animation to Web pages. Updated April 2014. Basics for beginners. See also https://github.com/macloo/canvas
Drupalcamp Leuven 2013 - Display Suite, the future of your displayBram Goffings
This document summarizes a presentation about porting the Display Suite module to Drupal 8. It discusses how Display Suite settings and custom fields are now stored in configuration files, allowing them to be exported and translated. It also explains that Display Suite now uses Twig templating to generate HTML for entity and field displays, as Drupal 8 has adopted Twig. The presentation includes a demo of Display Suite in Drupal 8 and discusses gains like improved configuration management and a more modular, extensible architecture from these changes.
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...Guillaume Kossi
Scalable Vector Graphics, or SVGs, are the new "big thing" in web design today, and for a good reason. With the proliferation of retina screens and high resolution displays, we need to adopt techniques that allow us to serve graphics that look good on all screens in all circumstances, and because SVGs offer resolution-independent, fully scalable and crystal clear graphics, it is safe to say that they are the future graphics format of the web.
In this talk we're going to see how SVGs can be styled in CSS, and how they can be animated using CSS animations and transitions. We're also going to cover "responsifying" SVGs using CSS media queries, and how we can control the size and looks of SVGs allowing them to adapt to different screen sizes. We'll cover a short workflow from a vector graphics editor to a responsive animated graphic on screen.
This document provides instructions for integrating AngularJS into an existing legacy HTML application. It describes how to add an Angular "micro-app" by specifying a container div with Angular directives like ng-app and ng-controller. The Angular code, including a module, controller, and function calls from the legacy code, can be kept separate. Template views can also be added using ng-view and routing configuration. The process is described as relatively simple and allowing incremental integration of Angular without rewriting the entire application.
Knockout.js is a JavaScript library that makes it easier to create dynamic and responsive user interfaces by binding a data model to HTML elements, automatically updating the UI when the data model changes. It provides declarative bindings, dependency tracking, templating, and other features to simplify building dynamic UIs using the MVVM pattern. Knockout.js works with any web framework, has no dependencies, and supports all major browsers.
The document discusses a scalable and modular architecture for CSS that involves categorizing styles into base, layout, module, and state categories. This approach helps make CSS more flexible, maintainable, and avoids overly specific selectors. Key aspects include naming conventions, limiting the depth of styles, and using child selectors. An example of a "media object" pattern is provided to demonstrate how abstracting styles into reusable modules can significantly reduce code. While this approach goes against some conventional wisdom, it separates structure and skin while promoting reusability.
Enhance your WordPress development with Twig through Clarkson - WordCamp Barc...Jaime Martínez
This document discusses using Twig and Clarkson to enhance WordPress development. Twig is a template engine that allows separation of view logic from controllers and models. Clarkson is a WordPress plugin that encourages object-oriented and maintainable code. Together they help separate concerns, make templates reusable, and work with WordPress objects as models. This approach results in easier to maintain projects and happier developers.
1) The document provides resources for a front-end development session including working files, slides, and an agenda.
2) It reviews HTML tags, CSS selectors, the box model, positioning, and Flexbox.
3) Instructions are given to install Atom plugins and review JavaScript and JQuery before adding an Express server to a webpage.
The document provides an overview of CSS (Cascading Style Sheets) methodology. It defines CSS as the language used for implementing designs on HTML documents. It then covers CSS basics including selectors, properties, conflicts resolution using specificity and cascade order. It also discusses the box model which defines how browsers handle rectangular boxes for elements. Finally, it offers some best practices tips such as resetting styles, separating content from design, and planning layout during HTML coding.
This power point is introduce a simple CSS animation
in this PPT you can learn a new CSS 3 animation property and how to use that do a simple animation
The document discusses different techniques for animation and graphics rendering in web browsers, including CSS transforms and animations, Canvas, SVG, WebGL, and HTML5 video. It provides code examples and comparisons of performance between techniques like Canvas with JavaScript versus Flash. Key technologies mentioned are CSS transforms, requestAnimationFrame, Box2D physics engine, Raphael.js for vector graphics, and WebGL shaders.
This document provides an overview of HTML5 and CSS3 topics. It begins with an agenda for HTML5 that covers basics like tags, attributes and elements. It then discusses HTML5 semantic elements and features like video, audio, and forms. For CSS3, it outlines modules including borders, backgrounds, gradients, text effects, web fonts, transforms, transitions, animations, columns and user interface. The document aims to introduce key concepts and properties for front-end development.
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
Here are the steps to build a basic horizontal navigation menu bar:
1. Create an unordered list <ul> with class="menu"
2. Add list items <li> for each menu item
3. Style the <ul> with display:inline-block and border-bottom
4. Style the <li> with display:inline-block, padding and hover effect
5. Add a class="current" to highlight the active page
6. Use a border-left on .current to create a left arrow
Let me know if any part needs more explanation! Building menus is a common task and these techniques will serve you well.
Similar to Angular js animate shashikant bhongale -20-7-16 (20)
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
Assessment and Planning in Educational technology.pptxKavitha Krishnan
In an education system, it is understood that assessment is only for the students, but on the other hand, the Assessment of teachers is also an important aspect of the education system that ensures teachers are providing high-quality instruction to students. The assessment process can be used to provide feedback and support for professional development, to inform decisions about teacher retention or promotion, or to evaluate teacher effectiveness for accountability purposes.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
1. Date:20-1-16
Reusing and Overriding Messages
In addition to prioritization, ngMessages also allows for including messages from a remote or an
inline template. This allows for generic collection of messages to be reused across multiple parts of
an application.
<script type="text/ng-template" id="error-messages">
<div ng-message="required">This field is required</div>
<div ng-message="minlength">This field is too short</div>
</script>
<div ng-messages="myForm.myField.$error" role="alert">
<div ng-messages-include="error-messages"></div>
</div>
However, including generic messages may not be useful enough to match all input fields,
therefore, ngMessages provides the ability to override messages defined in the remote template by
redefining them within the directive container.
<!-- a generic template of error messages known as "my-custom-messages" -->
<script type="text/ng-template" id="my-custom-messages">
<div ng-message="required">This field is required</div>
<div ng-message="minlength">This field is too short</div>
</script>
<form name="myForm">
<label>
Email address
<input type="email"
id="email"
name="myEmail"
2. ng-model="email"
minlength="5"
required />
</label>
<!-- any ng-message elements that appear BEFORE the ng-messages-include will
override the messages present in the ng-messages-include template -->
<div ng-messages="myForm.myEmail.$error" role="alert">
<!-- this required message has overridden the template message -->
<div ng-message="required">You did not enter your email address</div>
<!-- this is a brand new message and will appear last in the prioritization -->
<div ng-message="email">Your email address is invalid</div>
<!-- and here are the generic error messages -->
<div ng-messages-include="my-custom-messages"></div>
</div>
</form>
Feel free to use other structural directives such as ng-if and ng-switch to further control what
messages are active and when. Be careful, if you place ng-message on the same element as these
structural directives, Angular may not be able to determine if a message is active or not.
Therefore it is best to place the ng-message on a child element of the structural directive.
<div ng-messages="myForm.myEmail.$error" role="alert">
<div ng-if="showRequiredError">
<div ng-message="required">Please enter something</div>
</div>
</div>
<div ng-messages="myMessages" class="my-messages" role="alert">
<div ng-message="alert" class="some-message">...</div>
<div ng-message="fail" class="some-message">...</div>
</div>
3. Animations
If the ngAnimate module is active within the application then
the ngMessages, ngMessage and ngMessageExp directives will trigger animations whenever any
messages are added and removed from the DOM by the ngMessages directive.
Whenever the ngMessages directive contains one or more visible messages then the .ng-
active CSS class will be added to the element. The .ng-inactive CSS class will be applied when
there are no messages present. Therefore, CSS transitions and keyframes as well as JavaScript
animations can hook into the animations whenever these classes are added/removed.
Example in a animation
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-ngMessages-directive-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular-messages.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-animate.js"></script>
<script src="animatescript.js"></script>
<script type="text/javascript">
angular.element(document.getElementsByTagName('head')).append(angular.element('<base
href="' + window.location.pathname + '" />'));
</script>
</head>
<body ng-app="ngMessagesExample">
<style type="text/css">
.fade.ng-enter {
transition:0.5s linear all;
opacity:0;
}
.fade.ng-enter.ng-enter-active {
opacity:1;
}
.fade.ng-leave {
4. transition:0.5s linear all;
opacity:1;
}
.fade.ng-leave.ng-leave-active {
opacity:0;
}
.fade.ng-leave {
animation: my_fade_animation 0.5s linear;
-webkit-animation: my_fade_animation 0.5s linear;
}
@keyframes my_fade_animation {
from { opacity:1; }
to { opacity:0; }
}
@-webkit-keyframes my_fade_animation {
from { opacity:1; }
to { opacity:0; }
}
</style>
<div ng-if="bool" class="fade">
Fade me in out
</div>
<button ng-click="bool=true">Fade In!</button>
<button ng-click="bool=false">Fade Out!</button>
<br>
<div ng-show="bool1" class="fade1">
Show and hide me
</div>
<button ng-click="bool1=!bool1">Toggle</button>
<style>
.fade1.ng-hide {
transition:0.5s linear all;
opacity:0;
}
</style>
<div ng-class="{on:onOff}" class="highlight"> Highlight this box</div>
5. <button ng-click="onOff=!onOff">Toggle</button>
<style>
.highlight {
transition:0.5s linear all;
}
.highlight.on-add {
background:white;
}
.highlight.on {
background:yellow;
}
.highlight.on-remove {
background:black;
}
</style>
</body>
</html>
Installation
First, get the file:
Google CDN e.g.
"//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-animate.js"
Then, include angular-animate.js in your HTML:
<script src="path/to/angular.js"></script>
<script src="path/to/angular-animate.js"></script>
Finally, load the module in your application by adding it as a dependent module:
angular.module('app', ['ngAnimate']);
6. Directive Support
The following directives are "animation aware":
Directive SupportedAnimations
ngRepeat enter,leave andmove
ngView enterandleave
ngInclude enterandleave
ngSwitch enterandleave
ngIf enterandleave
ngClass add and remove (the CSSclass(es)present)
ngShow & ngHide add and remove (the ng-hide classvalue)
form& ngModel add and remove (dirty,pristine,valid,invalid&all other validations)
ngMessages add and remove (ng-active &ng-inactive)
ngMessage enterandleave
(More information can be found by visiting each the documentation associated with each directive.)
7. CSS-based Animations
CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By
using a CSS class that we reference between our HTML and CSS code we can create an animation
that will be picked up by Angular when an the underlying directive performs an operation.
The example below shows how an enter animation can be made possible on an element using ng-
if:
<div ng-if="bool" class="fade">
Fade me in out
</div>
<button ng-click="bool=true">Fade In!</button>
<button ng-click="bool=false">Fade Out!</button>
Notice the CSS class fade? We can now create the CSS transition code that references this class:
/* The starting CSS styles for the enter animation */
.fade.ng-enter {
transition:0.5s linear all;
opacity:0;
}
/* The finishing CSS styles for the enter animation */
.fade.ng-enter.ng-enter-active {
opacity:1;
}
The key thing to remember here is that, depending on the animation event (which each of the
directives above trigger depending on what's going on) two generated CSS classes will be applied to
the element; in the example above we have .ng-enter and.ng-enter-active. For CSS transitions,
the transition code must be defined within the starting CSS class (in this case .ng-enter). The
destination class is what the transition will animate towards.
If for example we wanted to create animations for leave and move (ngRepeat triggers move) then we
can do so using the same CSS naming conventions:
/* now the element will fade out before it is removed from the DOM */
8. .fade.ng-leave {
transition:0.5s linear all;
opacity:1;
}
.fade.ng-leave.ng-leave-active {
opacity:0;
}
We can also make use of CSS Keyframes by referencing the keyframe animation within the starting
CSS class:
/* there is no need to define anything inside of the destination
CSS class since the keyframe will take charge of the animation */
.fade.ng-leave {
animation: my_fade_animation 0.5s linear;
-webkit-animation: my_fade_animation 0.5s linear;
}
@keyframes my_fade_animation {
from { opacity:1; }
to { opacity:0; }
}
@-webkit-keyframes my_fade_animation {
from { opacity:1; }
to { opacity:0; }
}
Feel free also mix transitions and keyframes together as well as any other CSS classes on the same
element.
CSS Class-based Animations
Class-based animations (animations that are triggered via ngClass, ngShow, ngHide and some other
directives) have a slightly different naming convention. Class-based animations are basic enough
that a standard transition or keyframe can be referenced on the class being added and removed.
9. For example if we wanted to do a CSS animation for ngHide then we place an animation on the .ng-
hide CSS class:
<div ng-show="bool" class="fade">
Show and hide me
</div>
<button ng-click="bool=!bool">Toggle</button>
<style>
.fade.ng-hide {
transition:0.5s linear all;
opacity:0;
}
</style>
All that is going on here with ngShow/ngHide behind the scenes is the .ng-hide class is
added/removed (when the hidden state is valid). Since ngShow and ngHide are animation aware
then we can match up a transition and ngAnimate handles the rest.
In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods
that we can use to further decorate the animation with CSS styles.
<div ng-class="{on:onOff}" class="highlight">
Highlight this box
</div>
<button ng-click="onOff=!onOff">Toggle</button>
<style>
.highlight {
transition:0.5s linear all;
}
.highlight.on-add {
background:white;
}
.highlight.on {
background:yellow;
}
10. .highlight.on-remove {
background:black;
}
</style>
We can also make use of CSS keyframes by placing them within the CSS classes.
CSS Staggering Animations
A Staggering animation is a collection of animations that are issued with a slight delay in between
each successive operation resulting in a curtain-like effect. The ngAnimate module (versions >=1.2)
supports staggering animations and the stagger effect can be performed by creating a ng-EVENT-
stagger CSS class and attaching that class to the base CSS class used for the animation. The style
property expected within the stagger class can either be a transition-delay or an animation-
delay property (or both if your animation contains both transitions and keyframe animations).
.my-animation.ng-enter {
/* standard transition code */
transition: 1s linear all;
opacity:0;
}
.my-animation.ng-enter-stagger {
/* this will have a 100ms delay between each successive leave animation */
transition-delay: 0.1s;
/* As of 1.4.4, this must always be set: it signals ngAnimate
to not accidentally inherit a delay property from another CSS class */
transition-duration: 0s;
}
.my-animation.ng-enter.ng-enter-active {
/* standard transition styles */
opacity:1;
}
Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of
ngRepeat, to use staggering animations on your own, they can be triggered by firing multiple calls to
the same event on $animate. However, the restrictions surrounding this are that each of the
11. elements must have the same CSS className value as well as the same parent element. A stagger
operation will also be reset if one or more animation frames have passed since the multiple calls
to $animate were fired.
The following code will issue the ng-leave-stagger event on the element provided:
var kids = parent.children();
$animate.leave(kids[0]); //stagger index=0
$animate.leave(kids[1]); //stagger index=1
$animate.leave(kids[2]); //stagger index=2
$animate.leave(kids[3]); //stagger index=3
$animate.leave(kids[4]); //stagger index=4
window.requestAnimationFrame(function() {
//stagger has reset itself
$animate.leave(kids[5]); //stagger index=0
$animate.leave(kids[6]); //stagger index=1
$scope.$digest();
});
Stagger animations are currently only supported within CSS-defined animations.
The ng-animate CSS class
When ngAnimate is animating an element it will apply the ng-animate CSS class to the element for
the duration of the animation. This is a temporary CSS class and it will be removed once the
animation is over (for both JavaScript and CSS-based animations).
Therefore, animations can be applied to an element using this temporary class directly via CSS.
.zipper.ng-animate {
transition:0.5s linear all;
}
.zipper.ng-enter {
opacity:0;
}
12. .zipper.ng-enter.ng-enter-active {
opacity:1;
}
.zipper.ng-leave {
opacity:1;
}
.zipper.ng-leave.ng-leave-active {
opacity:0;
}
(Note that the ng-animate CSS class is reserved and it cannot be applied on an element directly
since ngAnimate will always remove the CSS class once an animation has completed.)
The ng-[event]-prepare class
This is a special class that can be used to prevent unwanted flickering / flash of content before the
actual animation starts. The class is added as soon as an animation is initialized, but removed
before the actual animation starts (after waiting for a $digest). It is also only added
for structural animations (enter, move, and leave).
In practice, flickering can appear when nesting elements with structural animations such as ngIf into
elements that have class-based animations such as ngClass.
<div ng-class="{red: myProp}">
<div ng-class="{blue: myProp}">
<div class="message" ng-if="myProp"></div>
</div>
</div>
It is possible that during the enter animation, the .message div will be briefly visible before it starts
animating. In that case, you can add styles to the CSS that make sure the element stays hidden
before the animation starts:
.message.ng-enter-prepare {
opacity: 0;
}
13. JavaScript-based Animations
ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar
to CSS-based animations (where there is a shared CSS class that is referenced in our HTML code)
but in addition we need to register the JavaScript animation on the module. By making use of
the module.animation() module function we can register the animation.
Let's see an example of a enter/leave animation using ngRepeat:
<div ng-repeat="item in items" class="slide">
{{ item }}
</div>
See the slide CSS class? Let's use that class to define an animation that we'll structure in our
module code by using module.animation:
myModule.animation('.slide', [function() {
return {
// make note that other events (like addClass/removeClass)
// have different function input parameters
enter: function(element, doneFn) {
jQuery(element).fadeIn(1000, doneFn);
// remember to call doneFn so that angular
// knows that the animation has concluded
},
move: function(element, doneFn) {
jQuery(element).fadeIn(1000, doneFn);
},
leave: function(element, doneFn) {
jQuery(element).fadeOut(1000, doneFn);
}
}
14. }]);
The nice thing about JS-based animations is that we can inject other services and make use of
advanced animation libraries such as greensock.js and velocity.js.
If our animation code class-based (meaning that something
like ngClass, ngHide and ngShow triggers it) then we can still define our animations inside of the
same registered animation, however, the function input arguments are a bit different:
<div ng-class="color" class="colorful">
this box is moody
</div>
<button ng-click="color='red'">Change to red</button>
<button ng-click="color='blue'">Change to blue</button>
<button ng-click="color='green'">Change to green</button>
myModule.animation('.colorful', [function() {
return {
addClass: function(element, className, doneFn) {
// do some cool animation and call the doneFn
},
removeClass: function(element, className, doneFn) {
// do some cool animation and call the doneFn
},
setClass: function(element, addedClass, removedClass, doneFn) {
// do some cool animation and call the doneFn
}
}
}]);
CSS + JS Animations Together
AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations
more flexible. However, unlike earlier versions of Angular, defining CSS and JS animations to work
off of the same CSS class will not work anymore. Therefore the example below will only result in JS
animations taking charge of the animation:
15. <div ng-if="bool" class="slide">
Slide in and out
</div>
myModule.animation('.slide', [function() {
return {
enter: function(element, doneFn) {
jQuery(element).slideIn(1000, doneFn);
}
}
}]);
.slide.ng-enter {
transition:0.5s linear all;
transform:translateY(-100px);
}
.slide.ng-enter.ng-enter-active {
transform:translateY(0);
}
Does this mean that CSS and JS animations cannot be used together? Do JS-based animations
always have higher priority? We can make up for the lack of CSS animations by using
the $animateCss service to trigger our own tweaked-out, CSS-based animations directly from our
own JS-based animation code:
myModule.animation('.slide', ['$animateCss', function($animateCss) {
return {
enter: function(element) {
// this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`.
return $animateCss(element, {
event: 'enter',
structural: true
});
}
}
}]);
16. The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and
we don't need to rely on a 3rd-party animation framework.
The $animateCss service is very powerful since we can feed in all kinds of extra properties that will
be evaluated and fed into a CSS transition or keyframe animation. For example if we wanted to
animate the height of an element while adding and removing classes then we can do so by providing
that data into $animateCss directly:
myModule.animation('.slide', ['$animateCss', function($animateCss) {
return {
enter: function(element) {
return $animateCss(element, {
event: 'enter',
structural: true,
addClass: 'maroon-setting',
from: { height:0 },
to: { height: 200 }
});
}
}
}]);
Now we can fill in the rest via our transition CSS code:
/* the transition tells ngAnimate to make the animation happen */
.slide.ng-enter { transition:0.5s linear all; }
/* this extra CSS class will be absorbed into the transition
since the $animateCss code is adding the class */
.maroon-setting { background:red; }
And $animateCss will figure out the rest. Just make sure to have the done() callback fire
the doneFn function to signal when the animation is over.
To learn more about what's possible be sure to visit the $animateCss service.
17. Animation Anchoring (via ng-animate-ref)
ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between
structural areas of an application (like views) by pairing up elements using an attribute called ng-
animate-ref.
Let's say for example we have two views that are managed by ng-view and we want to show that
there is a relationship between two components situated in within these views. By using the ng-
animate-ref attribute we can identify that the two components are paired together and we can then
attach an animation, which is triggered when the view changes.
Say for example we have the following template code:
<!-- index.html -->
<div ng-view class="view-animation">
</div>
<!-- home.html -->
<a href="#/banner-page">
<img src="./banner.jpg" class="banner" ng-animate-ref="banner">
</a>
<!-- banner-page.html -->
<img src="./banner.jpg" class="banner" ng-animate-ref="banner">
Now, when the view changes (once the link is clicked), ngAnimate will examine the HTML contents
to see if there is a match reference between any components in the view that is leaving and the view
that is entering. It will scan both the view which is being removed (leave) and inserted (enter) to see
if there are any paired DOM elements that contain a matching ref value.
The two images match since they share the same ref value. ngAnimate will now create a transport
element (which is a clone of the first image element) and it will then attempt to animate to the
position of the second image element in the next view. For the animation to work a special CSS
class called ng-anchor will be added to the transported element.
We can now attach a transition onto the .banner.ng-anchor CSS class and then ngAnimate will
handle the entire transition for us as well as the addition and removal of any changes of CSS
classes between the elements:
.banner.ng-anchor {
18. /* this animation will last for 1 second since there are
two phases to the animation (an `in` and an `out` phase) */
transition:0.5s linear all;
}
We also must include animations for the views that are being entered and removed (otherwise
anchoring wouldn't be possible since the new view would be inserted right away).
.view-animation.ng-enter, .view-animation.ng-leave {
transition:0.5s linear all;
position:fixed;
left:0;
top:0;
width:100%;
}
.view-animation.ng-enter {
transform:translateX(100%);
}
.view-animation.ng-leave,
.view-animation.ng-enter.ng-enter-active {
transform:translateX(0%);
}
.view-animation.ng-leave.ng-leave-active {
transform:translateX(-100%);
}
Now we can jump back to the anchor animation. When the animation happens, there are two stages
that occur: an out and an in stage. The out stage happens first and that is when the element is
animated away from its origin. Once that animation is over then the instage occurs which animates
the element to its destination. The reason why there are two animations is to give enough time for
the enter animation on the new element to be ready.
The example above sets up a transition for both the in and out phases, but we can also target the
out or in phases directly viang-anchor-out and ng-anchor-in.
.banner.ng-anchor-out {
transition: 0.5s linear all;
19. /* the scale will be applied during the out animation,
but will be animated away when the in animation runs */
transform: scale(1.2);
}
.banner.ng-anchor-in {
transition: 1s linear all;
}
Anchoring Demo
Edit in Plunker
index.htmlscript.jshome.htmlprofile.htmlanimations.css
<a href="#!/">Home</a>
<hr />
<div class="view-container">
<div ng-view class="view"></div>
</div>
How is the element transported?
When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly
where the starting element is located on screen via absolute positioning. The cloned element will be
placed inside of the root element of the application (where ng-app was defined) and all of the CSS
classes of the starting element will be applied. The element will then animate into
the out and in animations and will eventually reach the coordinates and match the dimensions of
the destination element. During the entire animation a CSS class of.ng-animate-shim will be
applied to both the starting and destination elements in order to hide them from being visible (th e
CSS styling for the class is: visibility:hidden). Once the anchor reaches its destination then it will
be removed and the destination element will become visible since the shim class will be removed.
How is the morphing handled?
CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to
figure out what CSS classes differ between the starting element and the destination element. These
20. different CSS classes will be added/removed on the anchor element and a transition will be applied
(the transition that is provided in the anchor class). Long story short, ngAnimate will figure out what
classes to add and remove which will make the transition of the element as smooth and automatic
as possible. Be sure to use simple CSS classes that do not rely on DOM nesting structure so that
the anchor element appears the same as the starting element (since the cloned element is placed
inside of root element which is likely close to the body element).
Note that if the root element is on the <html> element then the cloned node will be placed inside of
body.
Using $animate in your directive code
So far we've explored how to feed in animations into an Angular application, but how do we trigger
animations within our own directives in our application? By injecting the $animate service into our
directive code, we can trigger structural and class-based hooks which can then be consumed by
animations. Let's imagine we have a greeting box that shows and hides itself when the data changes
<greeting-box active="onOrOff">Hi there</greeting-box>
ngModule.directive('greetingBox', ['$animate', function($animate) {
return function(scope, element, attrs) {
attrs.$observe('active', function(value) {
value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on');
});
});
}]);
Now the on CSS class is added and removed on the greeting box component. Now if we add a CSS
class on top of the greeting box element in our HTML code then we can trigger a CSS or JS
animation to happen.
/* normally we would create a CSS class to reference on the element */
greeting-box.on { transition:0.5s linear all; background:green; color:white; }
The $animate service contains a variety of other methods like enter, leave, animate and setClass.
To learn more about what's possible be sure to visit the $animate service API page.
21. Callbacks and Promises
When $animate is called it returns a promise that can be used to capture when the animation has
ended. Therefore if we were to trigger an animation (within our directive code) then we can continue
performing directive and scope related activities after the animation has ended by chaining onto the
returned promise that animation method returns.
// somewhere within the depths of the directive
$animate.enter(element, parent).then(function() {
//the animation has completed
});
(Note that earlier versions of Angular prior to v1.4 required the promise code to be wrapped
using $scope.$apply(...). This is not the case anymore.)
In addition to the animation promise, we can also make use of animation-related callbacks within our
directives and controller code by registering an event listener using the $animate service. Let's say
for example that an animation was triggered on our view routing controller to hook into that:
ngModule.controller('HomePageController', ['$animate', function($animate) {
$animate.on('enter', ngViewElement, function(element) {
// the animation for this route has completed
}]);
}])
(Note that you will need to trigger a digest within the callback to get angular to notice any scope-
related changes.)
Module Components
Directive
Name Description
ngAnimateChildren ngAnimateChildren allows you to specify that children of this element
should animate even if any of the children's parents are currently animating.
22. By default, when an element has an active enter, leave, or move (structural)
animation, child elements that also have an active structural animation are
not animated.
ngAnimateSwap ngAnimateSwap is a animation-oriented directive that allows for the
container to be removed and entered in whenever the associated expression
changes. A common usecase for this directive is a rotating banner or slider
component which contains one image being present at a time. When the
active image changes then the old image will perform a leave animation and
the new element will be inserted via an enter animation.
Service
Name Description
$animateCss The $animateCss service is a useful utility to trigger customized CSS-based
transitions/keyframes from a JavaScript-based animation or directly from a
directive. The purpose of $animateCss is NOT to side-step how $animate and
ngAnimate work, but the goal is to allow pre-existing animations or directives to
create more complex animations that can be purely driven using CSS code.
$animate The ngAnimate $animate service documentation is the same for the
core $animate service.
Example
input[datetime-local]
1. - inputinmodule ng
<script>
angular.module('dateExample', [])
.controller('DateController', ['$scope', function($scope) {
$scope.example = {
value: new Date(2010, 11, 28, 14, 57)
};
}]);
</script>
<form name="myForm" ng-controller="DateController as dateCtrl">
<label for="exampleInput">Pick a date between in 2013:</label>
<input type="datetime-local" id="exampleInput" name="input" ng-
model="example.value"
23. placeholder="yyyy-MM-ddTHH:mm:ss" min="2001-01-01T00:00:00" max="2013-
12-31T00:00:00" required />
<div role="alert">
<span class="error" ng-show="myForm.input.$error.required">
Required!</span>
<span class="error" ng-show="myForm.input.$error.datetimelocal">
Not a valid date!</span>
</div>
<tt>value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
Protectot.js
var value = element(by.binding('example.value | date: "yyyy-MM-
ddTHH:mm:ss"'));
var valid = element(by.binding('myForm.input.$valid'));
var input = element(by.model('example.value'));
// currently protractor/webdriver does not support
// sending keys to all known HTML5 input controls
// for various browsers (https://github.com/angular/protractor/issues/562).
function setInput(val) {
// set the value of the element and force validation.
var scr = "var ipt = document.getElementById('exampleInput'); " +
"ipt.value = '" + val + "';" +
"angular.element(ipt).scope().$apply(function(s) {
s.myForm[ipt.name].$setViewValue('" + val + "'); });";
browser.executeScript(scr);
}
it('should initialize to model', function() {
expect(value.getText()).toContain('2010-12-28T14:57:00');
expect(valid.getText()).toContain('myForm.input.$valid = true');
});
it('should be invalid if empty', function() {
setInput('');
expect(value.getText()).toEqual('value =');
expect(valid.getText()).toContain('myForm.input.$valid = false');
});
it('should be invalid if over max', function() {
setInput('2015-01-01T23:59:00');
expect(value.getText()).toContain('');
expect(valid.getText()).toContain('myForm.input.$valid = false');
});
Reference site address https://docs.angularjs.org/api/ng/input/input%5Bnumber%5D