Skip to content

Instantly share code, notes, and snippets.

@mumairofficial
Last active October 31, 2017 14:26
Show Gist options
  • Select an option

  • Save mumairofficial/9094fd1a175d06739d3083ce25aa045e to your computer and use it in GitHub Desktop.

Select an option

Save mumairofficial/9094fd1a175d06739d3083ce25aa045e to your computer and use it in GitHub Desktop.
https://ultimateangular.com/angular-pro scrapping export course outline
// dom links
var sections = new Set(document.getElementsByClassName('videos__segment'));
// programming
var Section = {
heading: "",
chapters: []
}
var courseOutline = [];
function extractChapters(chaptersArray) {
let chapters = [];
for (chap of chaptersArray) {
let cleanUpTitles = chap.innerText.split('\n');
chapters.push(cleanUpTitles[0]);
}
return chapters;
}
function extractDetailsOf(sect) {
let container = {};
container.heading = sect[1].innerText;
container.chapters = extractChapters(sect[3].children);
courseOutline.push(container);
}
function exportChapters(outline) {
let print = '';
let hmm = new Set(outline);
hmm.forEach(chap => {
let chapters = chap.chapters;
print += '\n\n';
print += chap.heading;
print += '\n--\n';
for (let i = 0; i < chapters.length; i++) {
print += `${chapters[i]}\n`
}
})
console.log(print);
}
// init
sections.forEach(sect => extractDetailsOf(sect.childNodes), setTimeout(() => exportChapters(courseOutline), 1000))
Overview, setup and source files
--
Course introduction
Setup instructions
Source files
Advanced Components
--
Content projection with ng-content
Using ng-content with projection slots
Projecting and binding to components
@ContentChild and ngAfterContentInit
@ContentChildren and QueryLists
@ViewChild and ngAfterViewInit
@ViewChildren and QueryLists
@ViewChild and template #refs
Using ElementRef and nativeElement
Using the platform agnostic Renderer
Dynamic components with ComponentFactoryResolver
Dynamic component @Input data
Dynamic component @Output subscriptions
Destroying dynamic components
Dynamic components reordering
Dynamic <template> rendering with ViewContainerRef
Passing context to a dynamic <template>
Dynamic <template> rendering with ngTemplateOutlet
Using ngTemplateOutlet with context
ViewEncapsulation and Shadow DOM
ChangeDetectionStrategy.OnPush and Immutability
Directives
--
Creating a custom attribute Directive
@HostListener and host Object
Understanding @HostBinding
Using the exportAs property with template refs
Creating a custom structural Directive
Custom Pipes
--
Creating a custom pipe
Pipes as providers
Reactive Forms
--
Reactive Forms setup
FormControls and FormGroups
Componentizing FormGroups
Binding FormControls to <select>
FormGroup collections with FormArray
Adding items to the FormArray
Removing items from the FormArray
FormBuilder API
Http service and joining Observables
Subscribing to the valueChanges Observable
Updating and resetting FormGroups and FormControls
Custom form control base
Implementing a ControlValueAccessor
Adding keyboard events to our control
Validators object for FormControls
FormControl (custom) validators
FormGroup (custom) validators
Async (custom) validators
Routing
--
Enabling route tracing
Subscribing to router events
Router outlet events
Dynamic route resolves with snapshots
Auxiliary named router outlets
Navigating to auxiliary named outlets
Auxiliary Navigation API
Destroying auxiliary outlets
Resolving data for auxiliary outlets
Lazy-loading modules
Preloading lazy-loaded modules
Custom preloading strategies
Protecting lazy-loaded modules with canLoad
Guards with canActivate
Guards with canActivateChild
Guards with canDeactivate
Unit Testing
--
Karma setup and walkthrough
Testing isolate Pipes
Shallow testing Pipes
Testing Services with dependencies
Testing Component methods
Testing @Input and @Output bindings
Testing Component templates
Testing container Components with async providers
Using NO_ERRORS_SCHEMA
Testing an Attribute Directive
Dependency Injection and Zones
--
Providers and useValue
Using InjectionToken
Providers and useClass
Providers and useFactory
Providers and useExisting
Configurable NgModules
Zones and NgZone
State Management with Rx
--
State Management architecture overview
Creating an Observable Store with Rx
Container components setup
Populating the Store and component subscription
Composing new Observable streams from our Store
Integrating a stateless component
Component outputs back to Service
Updating our Store in a Service
Final Project
--
Setup instructions and code branches
Project setup, walkthrough, install
Firebase CLI and initial AoT deploy
AuthModule and child module setup
Login/Register reactive form components
AuthService and AngularFire integration
Reactive Store and AngularFire Observables
Stateless components and logout functionality
HealthModule setup and lazy loading
Implementing AuthGuards for lazy routes
Data layer, initiate Observable streams
Async Pipe "as" syntax and routing
Component architecture and Reactive Forms
Rendering streams into Stateless components
Stateless components and removing items
Route Params and Observable switchMaps
Reactive Form outputs and async / await
Workout module transition
Custom FormControl with ControlValueAccessor
Reactive Form conditionals
Custom Workout / Meal Pipes
Schedule Calendar, Observables, BehaviorSubject
Schedule controls and Date logic
Calendar date toggling
Rendering schedule sections from Observables
Emitting from Stateless components
Schedule assignment and Store
Hooking schedules into Firebase
Project review and deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment