Giter Club home page Giter Club logo

ngcourse2's Introduction

Angular Course From Rangle.io

This repository contains handout materials and code for Rangle.io's AngularJS training course, focusing on Angular.

This is meant to be used as a part of the course, which is normally offered as a 2-4 day event. See rangle.io/javascript-training.html for more information.

The Book

Read our Angular training book or visit our GitBook page to either view it in your browser or download a PDF, ePub or Mobi version.

The Code

The repository also contains a number of examples and exercises. To work with them:

Get the source code:

git clone https://github.com/rangle/ngCourse2
  • Navigate to your source folder and then install the dependencies:
cd /path/to/your/ngCourse2
npm install
  • Then run either the examples:
npm run examples

Your browser should load showing the folders the examples are stored in. Navigate around and see them in action. Changing the code will update the examples in real time.

  • or run the exercises:
npm run exercises

Your browser should load showing the folder the exercises are stored in. Navigate around and see them in action, be warned that the folders not marked with "_solution" might not work out of the box.

Feedback

We welcome your feedback - please take a moment to fill out this survey to let us know what you think.

Thanks!

Contributing

Text that is being contributed to the book must follow the style guide

ngcourse2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngcourse2's Issues

Typos

File 01-features.md line 556 this.toppings = toppings'; should be this.toppings = 'toppings';
File 01-features.md line 937 let set = [2, 3, 5, 7, 11]; (it was suggested that 'set' could be a different word).
File 05-di.md line 151 Hambuerger should be Hamburger.

Outline for Presenter Notes + Pick Live Coding Examples: Components

Acceptance Criteria:

  • An outline for presenter notes.
  • Enough detail so that the presenter can estimate the effort to complete the content.
  • Live Coding Examples picked

The webinar will be 2 hours in duration:
45 minutes presentation
45 minutes live coding
15 minutes Q&A

Here is a draft outline for presenter notes from April 11 meeting:
Writing Angular 2 templates====
Passing Data in and out of components
Pipes - improved filters
Components have style
Dependency injection and components
Building trees with components
Component life cycle
Structural directive
Template variables ===

Update code examples and plunkers to RC

Module names and some semantics have changed.

  • update pipe section
  • update structural directives section
  • update code samples
  • update Plunkers
  • Update examples folder

Outline for Presenter Notes + Pick Live Coding Examples: Architecture

Acceptance Criteria:

  • An outline for presenter notes.
  • Enough detail so that the presenter can estimate the effort to complete the content.
  • Live Coding Examples picked

The webinar will be 2 hours in duration:

  • 45 minutes presentation
  • 45 minutes live coding
  • 15 minutes Q&A

Draft outline from April 11 Online Training Discussion
Stateful vs stateless components
Component architecture
Flux style architecture and taming state
Change detection strategies
Building a maintainable service layer

https://docs.google.com/document/d/19o5H_yOB5_08r4bbT67Y3S-u4hVz6U0l6_boaUSqzmA/edit

Pick and Validate a markdown solution

Pick and validate a markdown solution for slides for the Angular 2 Webinar Series.

AC: (Thanks Seth!)

  • course developers can write slides in Markdown
  • the slides should be theme-able enough for marketing

Forms exercises use "shorthand" FormBuilder syntax

This is more of a best practices issue than anything else. It seems like we're recommending FormBuilder over templates, which makes sense. There are still two syntaxes to FormBuilder and some of our trainees are wondering why we use the "short hand" syntax instead of explicitly defining Controls.

To get around this we ended up doing two different versions on the fly.

We also had a request for a template version of the exercise. That also got done on the fly and it was really easy except for custom validation. To make a custom validator that worked in template only I ended up copying code from the Angular 2 source and producing a (mostly) functional validator that looks like:

import {Directive, Provider, forwardRef} from 'angular2/core';
import {NG_VALIDATORS} from 'angular2/common';
import {CONST_EXPR} from 'angular2/src/facade/lang';

const VALID_TOPPINGS = CONST_EXPR(
    new Provider(NG_VALIDATORS,
      {useExisting: forwardRef(() => ToppingValidator), multi: true}));

@Directive({
  selector: '[validTopping][ngControl],[validTopping][ngFormControl],[validTopping][ngModel]',
  providers: [VALID_TOPPINGS]
})
export class ToppingValidator implements Validator {
  validate(c: AbstractControl): {[key: string]: any} {
    const value = c.value ? c.value.toLowerCase() : '';
    const isValid = ['basil', 'tomato', 'fungi'].indexOf(value) !== -1;
    if (isValid) {
      return null;
    }
    return { 'invalidTopping': true };
  }
}

There's a lot of boilerplate here and there's probably a better way but quickly searching reveals little info on how to do custom validators on templates. This one works okay, but it does not correctly apply all of the modifiers like dirty/touched/pristine etc...

Outline for Webinar Sign Up: Routes

Draft of Outline for Webinar Signup from April 11 Online Training Discussion
"Rolling your Routes - Participants can expect to master the “location bar” with Angular 2 routes.”

Acceptance Criteria:

  • Overview, Objective, Target Audience, Assumed Audience Knowledge, What the Audience Member will learn:
  • A description of this webinar to which marketing can apply their marketing touch.
  • This is not the same as the outline for the presenter notes.
  • Detailed enough that participants will want to sign up for the webinar.
  • General enough that we can adjust the content as needed when we're writing it.
  • Here is an example of what we have posted in the past for ad-hoc webinars: http://go.rangle.io/webinar-intro-to-angular2-components http://go.rangle.io/webinar-intro-to-react-native

Outline for Webinar Sign Up: Architecture

raft of Outline for Webinar Signup from April 11 Online Training Discussion
"Amazing Angular 2 Architecture - ...."

https://docs.google.com/document/d/19o5H_yOB5_08r4bbT67Y3S-u4hVz6U0l6_boaUSqzmA/edit

Acceptance Criteria:

  • Overview, Objective, Target Audience, Assumed Audience Knowledge, What the Audience Member will learn:
  • A description of this webinar to which marketing can apply their marketing touch.
  • This is not the same as the outline for the presenter notes.
  • Detailed enough that participants will want to sign up for the webinar.
  • General enough that we can adjust the content as needed when we're writing it.
  • Here is an example of what we have posted in the past for ad-hoc webinars: http://go.rangle.io/webinar-intro-to-angular2-components
    http://go.rangle.io/webinar-intro-to-react-native

es6 examples do not always transpile correctly

Notably the block scoped examples get transpiled incorrectly and don't work. The code works natively in chrome. It's also worth checking if wrapping in a function fixes that particular example. There's some issues with the "module" being treated as global scope, and let/const do not pollute the global scope

At the top level of programs and functions, let, unlike var, does not create a property on the global object. For example:

as a reader I would like to know about query parameters

ngCourse2 talks about routeParams but there is also a notion of query params. These are fundamentally the same things wrt to usage but the Angular 2 docs do differentiate and we should too.

This could be demonstrated with the existing :message exercise by showing that removing :message turns the route param into a query param. Regardless the programmatic API is the same.

Outline for Webinar Sign Up: Components

Draft from April 11 Online Training Discussion
"Participants can expect to master Angular 2.0 templates, give them style and structure them into a real world application.”

Acceptance Criteria:

  • Overview, Objective, Target Audience, Assumed Audience Knowledge, What the Audience Member will learn:
  • A description of this webinar to which marketing can apply their marketing touch. This is not the same as the outline for the presenter notes.
  • Detailed enough that participants will want to sign up for the webinar.
  • General enough that we can adjust the content as needed when we're writing it.
  • Here is an example of what we have posted in the past for ad-hoc webinars:
    http://go.rangle.io/webinar-intro-to-angular2-components
    http://go.rangle.io/webinar-intro-to-react-native

Outline for Presenter Notes + Pick Live Coding Examples: Routes

Acceptance Criteria:

  • An outline for presenter notes.
  • Enough detail so that the presenter can estimate the effort to complete the content.
  • Live Coding Examples picked

The webinar will be 2 hours in duration:

  • 45 minutes presentation
  • 45 minutes live coding
  • 15 minutes Q&A

Draft Outline from April 11 Online Training Discussion
Basic Angular 1.x Style config
Lazy routes
Mountable / self contained child routes
Routing life cylce hooks
Routing parameters and state
Passing configured data in routes
Async routes?
Router outlets + multiple outlets
Containers vs. “stateless” components

https://docs.google.com/document/d/19o5H_yOB5_08r4bbT67Y3S-u4hVz6U0l6_boaUSqzmA/edit

Use `@Input` instead of `input: []` in component example

http://ngcourse.rangle.io/handout/components/app_structure/passing_data_into_components.html

Our styleguide prefers @Input over inputs: [] because it clearer - the declaration and the type are kept together.

So instead of this:

import {Component} from 'angular2/core';

@Component({
  selector: 'ngc-hello-component',
  inputs: ['name'],
  template: '<p>Hello, {{name}}</p>'
})
export class HelloComponent {
  name: string;
}

We should do this:

import {Component} from 'angular2/core';

@Component({
  selector: 'ngc-hello-component',
  template: '<p>Hello, {{name}}</p>'
})
export class HelloComponent {
  @Input() name: string;
}

Outline for Presenter Notes + Pick Live Coding Examples: Forms

Acceptance Criteria:

  • An outline for presenter notes.
  • Enough detail so that the presenter can estimate the effort to complete the content.
  • Live Coding Examples picked

The webinar will be 2 hours in duration:

  • 45 minutes presentation
  • 45 minutes live coding
  • 15 minutes Q&A

Draft outline from April 11 Online Training Discussion
Template driven approach to forms
Programmatic forms, explicit and “list”
Validation, built-in, custom, async
Observables
Styling forms - pristine, valid, …
Http
Testing Forms

https://docs.google.com/document/d/19o5H_yOB5_08r4bbT67Y3S-u4hVz6U0l6_boaUSqzmA/edit

Enterprises With Strict Firewalls Block Examples

So far in one instance our Observer example was blocked by a firewall. We re-wrote the example on the fly to use GitHub's API instead. This is not a huge problem but it's worth mentioning since we might have other enterprise clients with restrictive firewalls. Since they need GitHub for npm installs etc it seems like it might be more consistent?

I have a rough draft of a GitHub version.

Typescript exercise 3 solution is broken

Line 75 causes this TS error: Overload signature is not compatible with function implementation.

Here's the code:

function accessor(db: Dictionary, key: string, callback: NodeCallback);
function accessor(db: Dictionary, key: string, value: any,
                  callback: NodeCallback) {
  // ...
}

5.1 Observables - description of forEach is inaccurate

It's not synchronous.... we even say as much below.

We're basically saying that it's somehow 'more synchronous' than subscribe, without actually being synchronous. This could use some clarification.

Also the last paragraph in that section about try/catch is incorrect - that can't work.

DI View Bindings Example

@sumitarora brought to my attention the concept of view bindings. The tl;dr is that it's possible to bind a dependency to a particular component and have that dependency only accessible by its bound component.

We need to update the DI section with an example to reflect this. Sumit has an example in the works.

Outline for Webinar Sign Up: Forms

Draft of Outline for Webinar Signup from April 11 Online Training Discussion
"Forms without Fears- Participants can expect to master capturing data with Angular 2 forms, validating and sending it to a server.”

Acceptance Criteria:

  • Overview, Objective, Target Audience, Assumed Audience Knowledge, What the Audience Member will learn:
  • A description of this webinar to which marketing can apply their marketing touch.
  • This is not the same as the outline for the presenter notes.
  • Detailed enough that participants will want to sign up for the webinar.
  • General enough that we can adjust the content as needed when we're writing it.
  • Here is an example of what we have posted in the past for ad-hoc webinars: http://go.rangle.io/webinar-intro-to-angular2-components http://go.rangle.io/webinar-intro-to-react-native

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.