405 Matching Annotations
  1. Last 7 days
    1. For a more modern alternative to ngReact, we recommend react2angular, angular2react, and ngimport.
  2. Sep 2019
    1. --p or ``--projectand notconfig`. it takes the path the the folder containing tsconfig.json, and starting with 1.8, it will allow a full path to the file
    1. NPM was not and is still not designed to specifically be a node package manager. Yes it has a lot of useful features supporting node.js (some like node_modules is even hardcoded in node.js) but it actually doesn't care what language your software is written in. It is a package manager for your OS, just like apt and yum (or brew for you Mac users).
    2. This is because it's not a node-specific package manager so what it installs could be a Python script or a shell script or a binary executable written in assembly.
    1. ts-node enables you to execute TypeScript directly, just as you might execute JavaScript code using Node.
    1. forEach() loop other than by throwing an exception. If you need such behavior, the forEach() method is the wrong tool. Early termination may be accomplished with:
    1. Object.fromEntries = arr => Object.assign({}, ...arr.map( ([k, v]) => ({[k]: v}) ))
    2. Object.filter = (obj, predicate) => Object.fromEntries(Object.entries(obj).filter(predicate))
    1. Since TypeScript 1.4 static extensions can be added easily. The TypeScript team changed the lib.d.ts file to use interfaces for all static type definitions. The static type definitions are all named like [Type]Constructor: So if you want to add a static function to type Object, then add your definition to ObjectConstructor.
    1. Object.fromEntries = arr => Object.assign({}, ...arr.map( ([k, v]) => ({[k]: v}) ));
    2. Using reduce and Object.keys As (1), in combination with Object.assign Using map and spread syntax instead of reduce Using Object.entries and Object.fromEntries
  3. Aug 2019
    1. For every question you might have, please create a discussion thread, not a single comment. This makes it a bit easier to see and reply to the question, instead of questions and answers getting mixed together: