Introducing Angular 2 Concepts in Angular 1

Lukas Ruebbelke
InstructorLukas Ruebbelke
Share this video with your friends

Social Share Links

Send Tweet
Published 8 years ago
Updated 5 years ago

In this introductory lesson, we will discuss how the architectural concepts of Angular 2 can be applied to AngularJS 1.x. We will also take a brief tour of the concepts that we will be covering in this series as well as how the code is structured per lesson.

[00:00] Hello, and welcome to the series on how to build an Angular 1 application in an Angular 2 style. Angular 2 introduced a lot of new approaches and ideas on how to write Angular applications, which quite frankly, caught a lot of developers off-guard.

[00:17] Angular 2 simply did not look like anything that Angular 1 developers were used to writing. With new tooling, syntax, and even a new language, via TypeScript, a lot us had to go back to the drawing board, and learn Angular all over again.

[00:35] The upside is that the majority of these changes were architectural in nature, and the main pieces have been back-ported to Angular 1. My favorite part is how Angular 2 really brought component-driven development to the forefront of how we architect applications.

[00:53] It is the cornerstone for building large, non-trivial apps that are not only predictable, but scalable. This approach works really nicely in Angular 1.x with the introduction of module.component.

[01:08] In this series, we are going to revisit our old friend, Eggly -- the trusty bookmark manager -- and build it from the ground up using a component-driven approach.

[01:18] We are going to learn how to load modules and assets using Webpack. We'll see the basic structure of a component, how to build components using the new .component syntax, how to approximate inputs and outputs using isolated scope to create smart and dumb components, how to use component lifecycle hooks within our controllers, and what that means.

[01:48] We'll also see how dependency injection works in ES6, and how to test components using the new component controller, provided by [?] Mocks. Now I'm going to start at the 00-start branch and build our application from there.

[02:09] You can follow along. Or if you want to jump to a specific lesson, then you can check out the corresponding lesson branch and you'll be immediately caught up to wherever we are. You can see these branches here.

[02:24] By approaching our Angular 1 applications in an Angular 2 style, we immediately reap the benefits of best practices and a better architecture. It also sets the stage for a streamlined upgrade in the future, which is a nice side effect indeed.

egghead
egghead
~ just now

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today