AngularJS is an open-source JavaScript framework that assists with building single-page applications using Model-View-Controller architecture. It uses two-way data binding between models and views, and its directives and filters help manipulate DOM elements and format data for display. AngularJS implements dependency injection to modularize code and make components reusable. Scopes in AngularJS act as containers for models and facilitate inheritance between parent and child scopes.
We Will learn about:
What is AngularJs?
Key Points
Core Features of AngularJS
How is it works?
AngularJs Terminologies
AngularJs directives
How we start work on AngularJs?
AngularJs Tags
How we use Yeoman?
Advantages and Disadvantages
AngularJS is a JavaScript framework for building dynamic web applications. It augments HTML with custom attributes and directives to bind data and behaviors to the DOM. Key features include two-way data binding, reusable components, dependency injection, routing, and templating. AngularJS uses an MVC or MVVM pattern, with scopes providing the view model. The framework enhances HTML, encourages test-driven development, and makes single page apps possible.
AngularJS is an MVC framework for building client-side web applications. It uses two-way data binding between models and views, dependency injection to decouple modules, and directives to extend HTML. Key features include routing for single-page applications, services for reusable logic, and tools for testing AJAX code. AngularJS provides standard directives, services, and routing capabilities to build complete applications in the browser.
The document provides an overview of AngularJS and how to build single page applications with it. It discusses key AngularJS concepts like directives, filters, data binding and MVC architecture. It also presents steps to create a basic AngularJS application and build a responsive user management application as a project example. The document promotes an AngularJS course by Edureka that teaches these concepts over 21 hours of live online classes along with assignments and a project.
AngularJS is a JavaScript framework made by Google for building complex client-side applications.
Angular.js is a MVW (Model-View-Whatever) open-source JavaScript web framework that facilitates the creation of single-page applications (SPA) and data-driven apps.
Angular projects have a somewhat different structure than other JavaScript MVC frameworks, but it can be highly modular and easy to maintain once you understand the structure.
AngularJS is a JavaScript MVC framework developed by Google that lets you build well structured, easily testable, and maintainable front-end applications
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.
What is AngularJS
AngularJS main components
View / Controller / Module / Scope
Scope Inheritance.
Two way data binding
$watch / $digest / $apply
Dirty Checking
DI - Dependence Injection
$provider vs $factory vs $service
This document provides an overview of the AngularJS JavaScript framework. It discusses what AngularJS is, how it works, and its benefits. AngularJS is an MVC framework built by Google for building user interfaces with declarative programming and two-way data binding. It allows creating reusable components with directives and provides services for common tasks like data binding, dependency injection and RESTful APIs. The document highlights how AngularJS enables rapid prototyping, has a large community and structured codebase which can help startups build fast prototypes and robust solutions.
AngularJS is an open source web application framework. It was originally developed in 2009 by Misko Hevery and Adam Abrons. It is now maintained by Google. Its latest version is 1.4.4 .
AngularJS is a JavaScript framework for building single-page applications. It enhances HTML with new attributes and uses MVC/MVVM patterns. Key features include data binding, directives, filters, expressions and dependency injection. AngularJS makes it easier to organize web apps at the client-side by defining ways to structure code and adding custom tags/attributes to HTML. It also helps with common tasks in SPAs like routing, data loading and handling user events.
OCTO BOF - How to build Netvibes with AngularJSJonathan Meiss
AngularJS is an open-source MVC JavaScript framework that simplifies web development. It uses two-way data binding, MVC architecture, directives, filters, routing and custom services to build single page applications. Key features include views and templates, testability, and support for RESTful APIs. While it has a learning curve, developers appreciate its architecture and ability to build reusable, testable components.
AngularJS is a JavaScript MVC framework that makes it easier to build single-page applications. It deemphasizes DOM manipulation and uses data binding to synchronize data between models and views. Some key features include routing, dependency injection, testing capabilities, and directives that extend HTML with new attributes and elements. AngularJS applications use controllers to decorate a scope with model data and callbacks. The scope then synchronizes changes between the model and view.
AngularJS is a JavaScript framework that extends HTML with directives and binds data to HTML with expressions. Some key points:
- AngularJS extends HTML with directives like ng-app, ng-model, and ng-bind.
- Expressions written with double braces like {{expression}} output data on the HTML page.
- Modules define AngularJS applications and controllers control the application logic and data.
- Common directives include ng-init, ng-click, ng-repeat, and filters like currency and lowercase can be used.
- A shopping cart example demonstrates binding data with ng-repeat, adding items with ng-click, and removing with ng-click.
Material I prepared for a beginner's workshop on AngularJS. Feel free to change it for your own use. I would appreciate it if you attributed the original to me.
Angular js 1.3 presentation for fed nov 2014Sarah Hudson
AngularJS is an up-and-coming JavaScript framework supported and maintained by Google. Over the past year, usage for the framework has exploded, giving many developers reason to believe it's the next big thing. In this presentation by Angular developer Sarah Hudson, you will learn the basics of what Angular is and what it can do for your projects, as well as breaking down the components of Angular, what makes it unique, and how it gives developers more control over custom templates and elements.
Sections include:
• Core structure and components of Angular, such as custom directives, factories for sharing data, two-way binding, and modules
• Companion libraries to Angular, such as the popular AngularUI suite which includes UI-Bootstrap
• A brief overview of routing options from Angular's native routing to UI Router, and how it offers flexibility for your apps
AngularJS is a JavaScript framework that allows developers to create single-page applications. It provides features like data binding, directives, dependency injection and MVC architecture. The presentation provided an overview of AngularJS, its core features and concepts like modules, controllers, services and routing. Key benefits of AngularJS include building reusable components, easier testing and single page application capabilities.
"CNC web world is one of the excellent IT training institute in Pune".
This platform is an initiative by a team of well experienced staff for teaching.
We offer various programming languages like C, C++, JAVA, Android, Web designing,
PHP, .net,Digital marketing, Angular jS,software testing,Soft skill,UI designing.
We provide best industrial training with 100% placement assistance.
CNC web world delivered live classroom training program to students.
AngularJS (1.x) is a client-side framework for developing browser-based applications using model-view-whatever architecture. It was created by Google and is open source. AngularJS uses templates, modules, services, dependency injection and two-way data binding to build single page applications. Key features include bootstrapping, routing, directives and unit testing capabilities. Angular 2 is a complete rewrite of AngularJS and uses only class-based services rather than multiple options.
AngularJS is a JavaScript framework for building single-page web applications. It augments HTML to provide MVC capabilities and allows developers to write dynamic web apps without having to manipulate the DOM directly. AngularJS uses scopes to bind models and views, and filters to format data for display. Directives extend HTML and allow developers to create reusable components. Modules are used to organize code and keep the global namespace clean.
AngularJS is a very powerful JavaScript library. It is used in Single Page Application (SPA) projects. It extends HTML DOM with additional attributes and makes it more responsive to user actions. AngularJS is open source, completely free, and used by thousands of developers around the world. It is licensed under the Apache license version 2.0.
best angular js book/toturial provided by <a href="https://www.hopeseller.in/">hopeseller </a> this is best book to foer bignners to get knowledge about angular js
AngularJS is a JavaScript framework for building web applications using MVC architecture. It separates an application into three main components: models, views, and controllers. Scopes provide the link between models and views by allowing views to watch models and propagate changes. AngularJS differs from jQuery in that it focuses on designing the architecture first before building the application and views. Key features include data binding, dependency injection, and directives like ng-repeat and ng-src to manipulate the DOM.
1> IMPORTANT PARTS OF ANGULARJS
2> Angular Js FEATURES
3> ADVANTAGES / DISADVANTAGES OF ANGULARJS
4> THE ANGULARJS COMPONENTS
5> MVC
6> STEPS TO CREATE ANGULARJS APP
AngularJS is a JavaScript framework for building dynamic web applications and single page applications. It uses MVC architecture and allows two-way data binding between models and views. Core components include directives, controllers, services and filters. AngularJS makes AJAX calls using the $http service and handles routing and deep linking using $routeProvider. Common directives include ng-app, ng-model and ng-bind.
This document provides an introduction and overview of AngularJS, including:
1. AngularJS is an open source JavaScript framework maintained by Google to build single-page applications using MVC architecture. It features two-way data binding, routing, templates, and dependency injection.
2. The key components of AngularJS applications are controllers, views, services, and directives. Controllers handle view interaction, views present data using templates, services manage non-view logic, and directives create custom HTML elements.
3. Getting started with AngularJS only requires adding a script tag to load AngularJS and adding ng-app and ng-model directives to bind an input to a model. This provides
This presentation has been prepared by Oleksii Prohonnyi for internal Angular.js training to improve skills of newbies in JS/Angular.
Part 2 (Architecture): http://www.slideshare.net/oprohonnyi/dive-into-angular-part-2-architecture
Part 3 (Performance): http://www.slideshare.net/oprohonnyi/dive-into-angular-part-3-performance
Part 4 (Angular 2.0): http://www.slideshare.net/oprohonnyi/dive-into-angular-part-4-angular-20
Part 5 (Experience): https://www.slideshare.net/oprohonnyi/dive-into-angular-part-5-experience
This document provides an overview of AngularJS, including:
- AngularJS is an open source JavaScript framework for building single page applications. It extends HTML with directives and two-way data binding.
- Core AngularJS concepts include modules, controllers, scopes, templates, and data binding. AngularJS uses MVVM pattern rather than traditional MVC.
- Templates define the view and use bindings, filters and directives to display dynamic data from the model. Controllers manipulate the model and expose it to templates via scopes.
Angular 6 Training with project in hyderabad indiaphp2ranjan
ngularJS is one of the JavaScript open-source web application frameworks which is generally used to add an HTML page along with a tag. The major aim of AngularJS is to simplify the application development and testing performance by providing a framework called MVC (Model View Controller) Architecture. It enables the application to change from bulk amount of programming code into a simple code.
AngularJS is a JavaScript framework for building browser-based applications that uses a Model-View-Controller pattern. It allows defining custom tags in HTML and uses two-way data binding between models and views. AngularJS applications are cross-browser compliant and use less code than traditional JavaScript apps due to features like dependency injection and built-in services. The framework encapsulates portions of a page into single pages and makes applications easier to test, develop, and maintain.
This document provides an overview of AngularJS, including what it is, its key features, how it works, common terminology, directives, and how to get started using it with Yeoman. AngularJS is an open-source JavaScript framework maintained by Google that assists with building single-page applications using MVC architecture. It features two-way data binding, templates, dependency injection and directives to help organize applications. The document outlines steps for setting up a development environment with Yeoman, creating a sample app, and basic tasks like running and building the app.
This document provides an overview of AngularJS, including what it is, its key features and terminology, how it works, directives, and how to get started using Yeoman to build an AngularJS application. AngularJS is an open-source JavaScript framework that assists with building single-page applications using MVC architecture. It features two-way data binding, templates, dependency injection and directives to help organize applications. Yeoman provides tools like Yo, Grunt and Bower to help set up AngularJS development environments and build projects.
This document provides an overview of AngularJS, including its core features and concepts. It discusses how AngularJS is a client-side JavaScript framework that uses MVC architecture. Key points covered include two-way data binding, templates, dependency injection, modules, controllers, views, models, scopes, filters, services, and directives. Custom directives and their creation are demonstrated. The document aims to give attendees an introduction to AngularJS and its basic building blocks.
The document outlines an agenda for a presentation on AngularJS that covers:
1. An introduction to AngularJS and its core features like two-way data binding, templates, and MVC architecture.
2. Explanations and examples of key AngularJS concepts like directives, expressions, forms, services, modules, routing, and scopes.
3. Discussions of AngularJS advantages like fast development and scalability, and disadvantages like complexity.
4. References for further learning and a question/answer session.
AngularJS is a structural framework for building dynamic web applications. It uses HTML as a template language and extends HTML syntax to define application components clearly. AngularJS eliminates much of the code required for data binding and dependency injection. As a framework, AngularJS allows developers to create rich, responsive single page applications in an MVC-like structure using JavaScript. Some key features include data binding, scopes, controllers, services, and dependency injection.
The document summarizes an AngularJS workshop that covers AngularJS core principles, building a sample website, and AngularJS 2. It discusses building the sample site from scratch using tools like NodeJS, Bower, and Bootstrap. Key AngularJS concepts covered include modules, views, controllers, directives, routing, promises, and AngularJS 2.0. Hands-on tasks include adding routing, creating a header directive, loading data from a service, and validating a form.
Angular is a platform and framework for building single-page client applications using HTML and TypeScript. The basic building blocks of Angular include components, modules, directives, decorators, pipes, data binding, templates, and services. Components define views with templates and logic. Modules organize related code. Directives modify DOM elements. Decorators add metadata. Pipes transform data. Data binding syncs data and UI. Templates define views. Services provide reusable functionality.
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc
Six months into 2024, and it is clear the privacy ecosystem takes no days off!! Regulators continue to implement and enforce new regulations, businesses strive to meet requirements, and technology advances like AI have privacy professionals scratching their heads about managing risk.
What can we learn about the first six months of data privacy trends and events in 2024? How should this inform your privacy program management for the rest of the year?
Join TrustArc, Goodwin, and Snyk privacy experts as they discuss the changes we’ve seen in the first half of 2024 and gain insight into the concrete, actionable steps you can take to up-level your privacy program in the second half of the year.
This webinar will review:
- Key changes to privacy regulations in 2024
- Key themes in privacy and data governance in 2024
- How to maximize your privacy program in the second half of 2024
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfjackson110191
These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.
Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 :
- Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants.
- REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.
Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.
Coordinate Systems in FME 101 - Webinar SlidesSafe Software
If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights.
During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to:
- Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value
- Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems
- Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors
- Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported
- Look Ahead: Gain insights into where FME is headed with coordinate systems in the future
Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsMydbops
This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization.
Key Takeaways:
* Understand why connection pooling is essential for high-traffic applications
* Explore various connection poolers available for PostgreSQL, including pgbouncer
* Learn the configuration options and functionalities of pgbouncer
* Discover best practices for monitoring and troubleshooting connection pooling setups
* Gain insights into real-world use cases and considerations for production environments
This presentation is ideal for:
* Database administrators (DBAs)
* Developers working with PostgreSQL
* DevOps engineers
* Anyone interested in optimizing PostgreSQL performance
Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services
How RPA Help in the Transportation and Logistics Industry.pptxSynapseIndia
Revolutionize your transportation processes with our cutting-edge RPA software. Automate repetitive tasks, reduce costs, and enhance efficiency in the logistics sector with our advanced solutions.
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Chris Swan
Have you noticed the OpenSSF Scorecard badges on the official Dart and Flutter repos? It's Google's way of showing that they care about security. Practices such as pinning dependencies, branch protection, required reviews, continuous integration tests etc. are measured to provide a score and accompanying badge.
You can do the same for your projects, and this presentation will show you how, with an emphasis on the unique challenges that come up when working with Dart and Flutter.
The session will provide a walkthrough of the steps involved in securing a first repository, and then what it takes to repeat that process across an organization with multiple repos. It will also look at the ongoing maintenance involved once scorecards have been implemented, and how aspects of that maintenance can be better automated to minimize toil.
Best Programming Language for Civil EngineersAwais Yaseen
The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era.
Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.
An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)
Choose our Linux Web Hosting for a seamless and successful online presencerajancomputerfbd
Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently.
Visit- https://onliveserver.com/linux-web-hosting/
How Social Media Hackers Help You to See Your Wife's Message.pdfHackersList
In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...Toru Tamaki
Jindong Gu, Zhen Han, Shuo Chen, Ahmad Beirami, Bailan He, Gengyuan Zhang, Ruotong Liao, Yao Qin, Volker Tresp, Philip Torr "A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models" arXiv2023
https://arxiv.org/abs/2307.12980
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Angular js
2. “What is AngularJS?”
As defined on Wikipedia:AngularJS is an open-source JavaScript framework, maintained by
Google, which assists with running single-page applications. Its goal is to augment browser-
based applications with Model–View–Controller (MVC) capability, in an effort to make both
development and testing easier.
“Why is it Called AngularJS?”
Angular means having angles or sharp corners. HTML uses angle brackets. Hence, the name!
3. “Why AngularJS?”
There are other Javascript frameworks like JQuery, Mootools, Dojo and Backbone.
However to choose AngularJS based on our complex web application like adding
new rows into table dynamically with copy and cut functionality with AJAX features
and also the below mentioned factors were deciding in the choice of the framework.
4. When NotTo Use AngularJS
AngularJS was designed with data-driven apps in mind.
AngularJS an excellent choice if your app interacts with a lot of RESTful web services.
But if your app needs heavy DOM manipulations where model data is not the
focus, instead you might choose library like jQuery, DOJO.
If you want to develop a web application, basically a game or involves heavy graphics
manipulation, AngularJS is not a good choice.
In short, AngularJS is best if your UI is datadriven.
5. Two Way Data Binding
Classical Template Angular Templates
What is One-Way Data Binding?
In Common every HTML attribute specific to AngularJS is called directive and has a specific
role in an AngularJS application. Here HTML page is a template and since it is not a final
version and perhaps it rendered by web browser.
The ng-app directive marks the DOM element that contains the AngularJS application.
In the below code we have initialized 2 variables through ng-init directive.
A data binding can be specified in two different ways:
with curly braces: {{expression}}
with the ng-bind directive: ng-bind= “varName”
6. What isTwo-Way Data Binding?
In the below example , the we have a 2-Way Data Binding, when a model variable is
bound to a HTML element that can both change and display the value of the variable.
Here ng-model directive to bind a model variable to the HTML element that can not only
display its value, but also change it.
7. AngularJS Expression
Angular expressions are JavaScript-like code snippets that are usually placed in bindings such as
{{expression}}
Angular Expressions vs. JavaScript Expressions
Angular expressions are like JavaScript expressions with the following differences:
Context: JavaScript expressions are evaluated against the global window. In Angular,
expressions are evaluated against a scope
Forgiving: In JavaScript, trying to evaluate undefined properties generates ReferenceError or
TypeError. In Angular, expression evaluation is forgiving to undefined and null.
No Control Flow Statements: you cannot use the following in an Angular expression:
conditionals, loops, or exceptions.
Filters: You can use filters within expressions to format data before displaying it.
8. Directives & Filters
What are Directives & Filters?
Directives
At a high level directives are markers on DOM element which tells HTML compiler to attach a specified
behavior to that DOM element or even transform the DOM element and its children.
Angular comes with a set of these directives built-in, like ngBind, ngModel, ngRepeat and ngView.
Filters
A filter formats the value of an expression for display to the user.They can be used in view templates,
controllers or services.
AngularJS provides some in-built filters like for search, lowercase, uppercase, orderby and groupby.
Below given an example: – Simple table with ng-repeat directive and search filter.
11. MVM
AngularJs is MVW
MVW ModelView Whatever?
AngularJS is an MVW framework (Model-View-Whatever) where Whatever means
Whatever Works for You. The reason is that AngularJS can be used both as Model-View-
Controller (MVC) and Model-View-View-Model (MVVM) framework. But what’s important
to us is that we can build solid web apps with great structure and design with minimum
effort.
To Understand more on it here the blog : http://addyosmani.com/blog/understanding-
mvvm-a-guide-for-javascript-developers/
12. MVC – ModelView Controller
MVC application structure was introduced in the 1970s as part of Smalltalk and now it
became one of the popular Design Pattern.
The core idea behind MVC is that we have clear separation in our code between managing
its data (model), the application logic (controller), and presenting the data to the user
(view).
Let we see that how this design pattern plays an important role in AngularJs.
In Angular applications,
13. Controller
A controller is a JavaScript function
• contains data
• specifies the behavior
• should contain only the business logic needed for a single view.
14. Scope
Scopes are a core fundamental of any Angular app. Scopes serve as the glue between the controller
and the view.
•Scope is an object that refers to the application model.
•Scopes are arranged in hierarchical structure which mimic the DOM structure of the application
•Scopes are the source of truth for the application state
16. Dependency Injection & AJAX Support
Dependency Injection
AngularJS comes with a built-in dependency injection mechanism. Dependency Injection (DI) is a
software design pattern that deals with how components get hold of their dependencies. We can
divide our application into multiple different types of components which AngularJS can inject into
each other. Modularizing our application makes it easier to reuse and configure the components in our
application.
Let us see how we can inject the custom directive into the controller
Directive for IE 8 Select Option Issue
17. Dependency Injection & AJAX Support
Note: Below I have given how to inject and to use in our presentation layer
Include in your Controller and Presentation Layer
18. Dependency Injection & AJAX Support
Note: Below I have given how to inject and to use in our presentation layer
Include in your Controller and Presentation Layer
19. Scope
As we saw a Scope is glue between Model andView.
Essentially, a scope is nothing but a plain old JavaScript object, and that is just a container
for key/value pairs, as follows:
var myObject={name:'AngularJS', creator:'Misko'}
A scope—like other objects—can have properties and functions attached to it.
The only difference is that we don't usually construct a scope object manually.
Rather, AngularJS automatically creates and injects one for us.
In our example, we attached properties to the scope inside the controller:
20. Every AngularJS application has at least one scope called $rootScope.
$rootScope is the parent of all scopes
All the properties attached to $rootScope are implicitly available to scope 1.
Similarly, scope 2 has access to all the properties attached to scope 1.
Every JavaScript constructor function has a property called prototype which points to an
object.
When you access a property on an object (someObject.someProperty) JavaScript searches for
the property in that object. If it's found, it is returned. If not, then JavaScript starts searching
for the property in the object's prototype.
The prototype property is nothing but another object.
<div ng-app> <!-- creates a $rootScope -->
<div ng-controller="OuterController">
<!--creates a scope (call it scope 1) that inherits from $rootScope-->
<div ng-controller="InnerController">
<!-- Creates a child scope (call it scope 2) that inherits from scope 1 -->
</div>
</div>
</div>
22. Writing a Primitive to an Object
Our object bike does not have a property year, but Bike.prototype does. When you
try to read bike.year you get the value from bike.prototype. But you can also attach
the property year to bike, like this:
bike.year=2000 //sets property 'year' on bike
console.log(bike.year); // returns 'year' property from bike and NOT from bike.prototype
console.log(bike.hasOwnProperty('year')); //returns true as Bike has 'year' property
Now,When you attach a new property to an object the property is attached to it and not
the prototype. Subsequently when you access the property, JavaScript no longer
consults the prototype because the property is found right there in the object itself.
23. Writing a ReferenceType to an Object
Let's attach an object called data to Bike.prototype:
Bike.prototype.data={}; //set it to empty object
Now have a look at the following code:
bike.data.engine='rear'; //This does not create a new property called 'data' on bike object
console.log(bike.data.engine); //returns 'rear' and it comes from Bike.prototype
console.log(bike.hasOwnProperty('data')); // false, as bike doesn't have own property
'data‘
Bike.prototype.hasOwnProperty('data'); // 'data' property is created in prototype.
24. Objects Can Extend Objects
Objects can extend other objects in JavaScript, and this is the key to understanding
AngularJS scope inheritance. Have a look at the following snippet:
var honda=Object.create(bike);
console.log(Object.getPrototypeOf(honda)); //Bike {}
Object.create() creates a new object whose internal prototype property points
to the object specified as the first argument to the function. As a result the honda
object's prototype now points to bike object.Therefore, honda has all the properties
defined in the bike instance.
This a quick overview of prototypal inheritance
25. Prototypal Inheritance in AngularJS Scopes
The $rootScope object has a function called $new() that's used to create child
scopes. Let's consider the previous example where we nested two controllers and
had one $rootScope.The code is repeated below:
<div ng-app> <!-- creates a $rootScope -->
<div ng-controller="OuterController">
<!--creates a scope (call it scope 1) that inherits from $rootScope-->
<div ng-controller="InnerController">
<!-- Creates a child scope (call it scope 2) that inherits from scope 1 -->
</div>
</div>
</div>
26. The below diagram, taken from the AngularJS GitHub page, depicts how scopes
inherit each other.