Linked Questions
29 questions linked to/from Importing lodash into angular2 + typescript application
1
vote
1
answer
812
views
Error using lodash in angular2 [duplicate]
I'm trying to use lodash in angular 2.4.0
angular-cli : "@angular/cli": "1.0.0-rc.4",
Tried to import like this
import * as _ from 'lodash';
Also tried
npm install --save lodash
npm install --...
1
vote
0
answers
647
views
How do I import UMD package in requirejs when getting "x is not a module" error? [duplicate]
^^^^^ No, it doesn't for two reasons. 1 - not using Angular2 (or I would have flagged it). 2 - the solution given in that "duplicate" clearly would never work - neither of the errors I'm getting ...
71
votes
16
answers
306k
views
How to compare two JSON have the same properties without order?
I have tried to compare those two JSON objects:
<input type="hidden" id="remoteJSON" name="remoteJSON" value='{"allowExternalMembers": "false", "whoCanJoin": "CAN_REQUEST_TO_JOIN"}' /><br /&...
174
votes
3
answers
91k
views
TypeScript typings in npm @types org packages
I've noticed there's an npm organization @types, which contains typing packages, but can't find any documentation on it. How are these meant to be used?
Is it meant to be used with typings tool? If ...
76
votes
4
answers
102k
views
Correct way of importing and using lodash in Angular
I used to be able to use a lodash method in Angular by an import statement that looked like the following:
import {debounce as _debounce} from 'lodash';
I now get the following error when using that ...
41
votes
3
answers
44k
views
Angular 2 - Merging (extending) objects
How to merge 2 objects with Angular 2?
In AngularJS 1 we have the "merge" and "extend" functions:
https://docs.angularjs.org/api/ng/function/angular.merge
https://docs.angularjs.org/api/ng/function/...
19
votes
8
answers
23k
views
Lodash - '_' refers to a UMD global and lodash.js is not a module errors
If I do nothing and add the type definition it works for jquery but lodash gets a
'_' referes to a UMD global, but the current file is a module. Consider adding an import instead.
If I try to import ...
14
votes
2
answers
20k
views
TS2307 Build:Cannot find module 'lodash'
Update
I apologise, I did not explain my issue very clearly. The errors I was getting was not while compiling the Angular application via Gulp, but in the Visual Studio 'Errors List'. I have since ...
10
votes
1
answer
8k
views
Why do i need `typings.json` file in an Angular 2 project?
Why do i need typings.json like below:
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160725163759",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "...
2
votes
1
answer
10k
views
How to display only unique values in the dropdown using Angular 2
I have a JSON data from which I am displaying 'accountNumber' into a dropdown using *ngFor. Since there are multiple entries in JSON data with the same account number, I am seeing the same account ...
-2
votes
1
answer
7k
views
Angular Pipe to Hide Duplicates from Array
I want to create a pipe to check specific object, not all. This Pipe will have to hide duplicate.
Pipe
import { Pipe } from '@angular/core'
@Pipe({
name: 'removeduplicates'
})
export class ...
-2
votes
2
answers
4k
views
How to sort data coming from the API by date in Angular 4
This is the JSON data i am fetching from POSTMAN. I want it to be ordered in a nearest to todays date. I tried many angular pipes but unfortunately nothings working. Any help would be great. I want to ...
6
votes
2
answers
3k
views
How to extend underscore using Typescript 2.0
I have the following snippet to extend underscore with sum function
//underscore.extension.ts
import * as _ from "underscore"
declare module "underscore" {
export interface UnderscoreStatic {...
3
votes
1
answer
3k
views
Cannot find module "lodash," but it works
I'm trying to import lodash into a file in Angular2 with TypeScript built with Webpack. I always get an error Cannot find module 'lodash' or Cannot find module 'lodash/submodule'. However, the code ...
2
votes
2
answers
678
views
Importing visionmedia debug in Angular 2 app with System.js and how to log messages?
I am working on a MEAN stack app with Angular 2 frontend. I have successfully used debug in the express app. However I am unable to cleanly import debug in app.components.ts or main.module.ts. Any ...