after importing function in angular I get xxx is not a functionHow do I import an SQL file using the command line in MySQL?How to import component into another root component in Angular 2angular 2 app component not loadingGet incorrect offsetWidth and offsetHeight valuesImport node js module in angular 2 applicationAngular Cli- In StyleURL add a css file located in the node_module directoryHow in angular 2+, dynamically manage the addition of animations (:enter and :leave) under certain conditions?Using materialize-css (v 1.0.0) in Angular 5 does not workAngular HTTP request error: “post valid request”How to use google Transliterate in angular 6?
Why would an AC motor heavily shake when driven with certain frequencies?
How should Thaumaturgy's "three times as loud as normal" be interpreted?
Short story: Interstellar inspector senses "off" nature of planet hiding aggressive culture
Friend is very nitpicky about side comments I don't intend to be taken too seriously
Leaving the USA for 10 yrs when you have asylum
Write a Schrödinger's sentence
Poor management handling of recent sickness and how to approach my return?
Features seen on the Space Shuttle's solid booster; what does "LOADED" mean exactly?
Does the word voltage exist in academic engineering?
How can I return only the number of paired values in array?
I need to know information from an old German birth certificate
Is there a way to deal with desistance in a off-chain game?
Can multiple public keys lead to the same shared secret in x25519?
Why would an airport be depicted with symbology for runways longer than 8,069 feet even though it is reported on the sectional as 7,200 feet?
Word for something that used to be popular but not anymore
Remove outer padding in tikzcd
How to say "In Japan, I want to ..."?
Why did Tony's Arc Reactor do this?
What exactly is Apple Cider
Owner keeps cutting corners and poaching workers for his other company
What can we do about our 9-month-old putting fingers down his throat?
Why does PAUSE key have a long make code and no break code?
Bacteria vats to generate edible biomass, require intermediary species?
Do you need to burn fuel between gravity assists?
after importing function in angular I get xxx is not a function
How do I import an SQL file using the command line in MySQL?How to import component into another root component in Angular 2angular 2 app component not loadingGet incorrect offsetWidth and offsetHeight valuesImport node js module in angular 2 applicationAngular Cli- In StyleURL add a css file located in the node_module directoryHow in angular 2+, dynamically manage the addition of animations (:enter and :leave) under certain conditions?Using materialize-css (v 1.0.0) in Angular 5 does not workAngular HTTP request error: “post valid request”How to use google Transliterate in angular 6?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am a beginner in Angular2. I'd like to use a function from a 3rd party library, but I get "xxx is not a function".
This is the code in 'app.component.ts':
import Component, OnInit from '@angular/core';
import arrayShuffle from "array-shuffle";
@Component(
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
)
export class AppComponent implements OnInit
name = 'Angular';
list: string[] = [];
ngOnInit()
this.list.push("C value");
this.list.push("B value");
this.list.push("A value");
console.log("list: " + this.list);
const shuffled = arrayShuffle(this.list);
console.log("list: " + this.list);
This is the whole thing on stackblitz
What is my mistake?
add a comment |
I am a beginner in Angular2. I'd like to use a function from a 3rd party library, but I get "xxx is not a function".
This is the code in 'app.component.ts':
import Component, OnInit from '@angular/core';
import arrayShuffle from "array-shuffle";
@Component(
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
)
export class AppComponent implements OnInit
name = 'Angular';
list: string[] = [];
ngOnInit()
this.list.push("C value");
this.list.push("B value");
this.list.push("A value");
console.log("list: " + this.list);
const shuffled = arrayShuffle(this.list);
console.log("list: " + this.list);
This is the whole thing on stackblitz
What is my mistake?
add a comment |
I am a beginner in Angular2. I'd like to use a function from a 3rd party library, but I get "xxx is not a function".
This is the code in 'app.component.ts':
import Component, OnInit from '@angular/core';
import arrayShuffle from "array-shuffle";
@Component(
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
)
export class AppComponent implements OnInit
name = 'Angular';
list: string[] = [];
ngOnInit()
this.list.push("C value");
this.list.push("B value");
this.list.push("A value");
console.log("list: " + this.list);
const shuffled = arrayShuffle(this.list);
console.log("list: " + this.list);
This is the whole thing on stackblitz
What is my mistake?
I am a beginner in Angular2. I'd like to use a function from a 3rd party library, but I get "xxx is not a function".
This is the code in 'app.component.ts':
import Component, OnInit from '@angular/core';
import arrayShuffle from "array-shuffle";
@Component(
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
)
export class AppComponent implements OnInit
name = 'Angular';
list: string[] = [];
ngOnInit()
this.list.push("C value");
this.list.push("B value");
this.list.push("A value");
console.log("list: " + this.list);
const shuffled = arrayShuffle(this.list);
console.log("list: " + this.list);
This is the whole thing on stackblitz
What is my mistake?
edited Mar 28 at 7:42
riskop
asked Mar 28 at 7:29
riskopriskop
1,0459 silver badges26 bronze badges
1,0459 silver badges26 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
change your import line from
import arrayShuffle from "array-shuffle";
to
import arrayShuffle from "array-shuffle";
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392215%2fafter-importing-function-in-angular-i-get-xxx-is-not-a-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
change your import line from
import arrayShuffle from "array-shuffle";
to
import arrayShuffle from "array-shuffle";
add a comment |
change your import line from
import arrayShuffle from "array-shuffle";
to
import arrayShuffle from "array-shuffle";
add a comment |
change your import line from
import arrayShuffle from "array-shuffle";
to
import arrayShuffle from "array-shuffle";
change your import line from
import arrayShuffle from "array-shuffle";
to
import arrayShuffle from "array-shuffle";
answered Mar 28 at 7:42
NiraliNirali
1709 bronze badges
1709 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392215%2fafter-importing-function-in-angular-i-get-xxx-is-not-a-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown