- Users want to compose reducer tree across modules
- Idea of a single reducer function makes it difficult for the library to dynamically augment the shape of the state tree
- Turning control over to the library to build the root reducer limits the use of meta-reducers
- Feature modules may inadvertently collide with the state of the root module
- Library authors may want to leverage @ngrx/store in their projects and provide an easy way
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var score_poker_hand = (function () { | |
| // This program creates and uses two enumeration objects: | |
| // rank_value and score_prefix. | |
| // The score_poker_hand function takes a hand (an array of cards). The hand | |
| // can contain between 5 and 9 cards, within which it will find the best five | |
| // card poker hand. A hand is an array of objects containing rank and suit | |
| // properties. The order of the cards is not significant. The hand is not | |
| // modified. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Simple JavaScript Inheritance | |
| * By John Resig http://ejohn.org/ | |
| * MIT Licensed. | |
| */ | |
| // Inspired by base2 and Prototype | |
| (function(){ | |
| var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.
What is the role of
.component()?
- Declares new HTML via a
templateortemplateUrl - Should be used to create Components as part of a Component architecture
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "status": "ok", | |
| "results_time": "12.0041 sec.", | |
| "results_count": 701, | |
| "results": [ | |
| { | |
| "key": "baby clothes", | |
| "cmp": 0.9990850304818497, | |
| "cpc": 1.188172, | |
| "sv": 110000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| router.all('/incaseoferror', async(req, res, next) => { | |
| const promise = await new Promise(function (resolve, reject) { | |
| setTimeout(function () { | |
| reject(new Error('this is a test err')); | |
| }, 3000); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('zone.js/dist/zone-node'); | |
| Zone.current.fork({ | |
| onHandleError: | |
| (parentZoneDelegate, currentZone, targetZone, | |
| error) => { | |
| console.log('should be error here', error); | |
| // return parentZoneDelegate.handleError(targetZone, error); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| helper.ts: | |
| export const HelperMethod = () => { | |
| return {}; | |
| }; | |
| app.ts: | |
| import { HelperMethod } from './helper'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| default-image.directive.ts: | |
| import { Directive, Input, HostListener, ElementRef } from '@angular/core'; | |
| @Directive({ | |
| selector: 'img[default]', | |
| }) | |
| export class DefaultImageDirective { | |
| @Input() default: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update | |
| sudo apt-get install libssl-dev g++ make | |
| curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash | |
| . ~/.nvm/nvm.sh | |
| nvm install node |