Dynamic Carosel images not showing with ngFor (Angular 7)Angular HTML binding@Directive v/s @Component in AngularHow can I get new selection in “select” in Angular 2?How to apply filters to *ngFor?*ngIf and *ngFor on same element causing errorAngular 2 Show and Hide an elementngFor with index as value in attributeaccess key and value of object using *ngForHuge number of files generated for every Angular projectangular viewChild for dynamic elements inside ngFor

Does two puncture wounds mean venomous snake?

Look mom! I made my own (Base 10) numeral system!

Non-OR journals which regularly publish OR research

Ex-contractor published company source code and secrets online

Are any jet engines used in combat aircraft water cooled?

Write an interpreter for *

Why did Gandalf use a sword against the Balrog?

Dereferencing a pointer in a 'for' loop initializer creates a segmentation fault

How can I iterate this process?

Why are Gatwick's runways too close together?

Why couldn't soldiers sight their own weapons without officers' orders?

In reversi, can you overwrite two chips in one move?

What's this thing in a peltier cooler?

How do I calculate the difference in lens reach between a superzoom compact and a DSLR zoom lens?

Why doesn't the "actual" path matter for line integrals?

Why should we care about syntactic proofs if we can show semantically that statements are true?

Unique combinations of a list of tuples

Which likelihood function is used in linear regression?

Double blind peer review when paper cites author's GitHub repo for code

Are there any differences in causality between linear and logistic regression?

How to use grep to search through the --help output?

(11 of 11: Meta) What is Pyramid Cult's All-Time Favorite?

What word can be used to describe a bug in a movie?

Does a code snippet compile? Or does it get compiled?



Dynamic Carosel images not showing with ngFor (Angular 7)


Angular HTML binding@Directive v/s @Component in AngularHow can I get new selection in “select” in Angular 2?How to apply filters to *ngFor?*ngIf and *ngFor on same element causing errorAngular 2 Show and Hide an elementngFor with index as value in attributeaccess key and value of object using *ngForHuge number of files generated for every Angular projectangular viewChild for dynamic elements inside ngFor






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am setting up a carousel for showing dynamic images fetching from an Node API. I am using ngFor directive in Angular 7



Here is my code that i have tried:



TypeScript:



getPromotions() 
this.dashboardService.getPromotions()
.subscribe(res =>

this.promotions = res.listings.map(res =>
return image: `data:$
res.file_mime_type
;base64,$this.dashboardService.bufferToString(res.file_content.data)`
);


console.log('Promotions::', this.promotions);

, err =>

)



html:



<div class="card">
<div class="card-body">
<ngb-carousel>
<ng-template ngbSlide *ngFor="let promotion of promotions">
<img [src]="promotion.image" height="392" class="d-block w-100" alt="Random slide">
<div class="carousel-caption">
<h3>No Promotion</h3>
<p>There is not active Promotion.</p>
</div>
</ng-template>
</ngb-carousel>
</div>
</div>


This code should show the images in promotions array but it showing nothing.










share|improve this question
























  • Meaby ngb-carousel load templates only on init, when there is no data inside this.promotions?

    – Patryk Uszyński
    Mar 27 at 7:52











  • @PatrykUszyński i have tried with image with index 0 in the promotions array. and It showing that image. but problem with this for loop i think

    – Nabeel Ahmad Khan
    Mar 27 at 8:06











  • same issue. did u find any solution @NabeelAhmadKhan

    – Gvs Akhil
    May 26 at 13:32

















0















I am setting up a carousel for showing dynamic images fetching from an Node API. I am using ngFor directive in Angular 7



Here is my code that i have tried:



TypeScript:



getPromotions() 
this.dashboardService.getPromotions()
.subscribe(res =>

this.promotions = res.listings.map(res =>
return image: `data:$
res.file_mime_type
;base64,$this.dashboardService.bufferToString(res.file_content.data)`
);


console.log('Promotions::', this.promotions);

, err =>

)



html:



<div class="card">
<div class="card-body">
<ngb-carousel>
<ng-template ngbSlide *ngFor="let promotion of promotions">
<img [src]="promotion.image" height="392" class="d-block w-100" alt="Random slide">
<div class="carousel-caption">
<h3>No Promotion</h3>
<p>There is not active Promotion.</p>
</div>
</ng-template>
</ngb-carousel>
</div>
</div>


This code should show the images in promotions array but it showing nothing.










share|improve this question
























  • Meaby ngb-carousel load templates only on init, when there is no data inside this.promotions?

    – Patryk Uszyński
    Mar 27 at 7:52











  • @PatrykUszyński i have tried with image with index 0 in the promotions array. and It showing that image. but problem with this for loop i think

    – Nabeel Ahmad Khan
    Mar 27 at 8:06











  • same issue. did u find any solution @NabeelAhmadKhan

    – Gvs Akhil
    May 26 at 13:32













0












0








0








I am setting up a carousel for showing dynamic images fetching from an Node API. I am using ngFor directive in Angular 7



Here is my code that i have tried:



TypeScript:



getPromotions() 
this.dashboardService.getPromotions()
.subscribe(res =>

this.promotions = res.listings.map(res =>
return image: `data:$
res.file_mime_type
;base64,$this.dashboardService.bufferToString(res.file_content.data)`
);


console.log('Promotions::', this.promotions);

, err =>

)



html:



<div class="card">
<div class="card-body">
<ngb-carousel>
<ng-template ngbSlide *ngFor="let promotion of promotions">
<img [src]="promotion.image" height="392" class="d-block w-100" alt="Random slide">
<div class="carousel-caption">
<h3>No Promotion</h3>
<p>There is not active Promotion.</p>
</div>
</ng-template>
</ngb-carousel>
</div>
</div>


This code should show the images in promotions array but it showing nothing.










share|improve this question














I am setting up a carousel for showing dynamic images fetching from an Node API. I am using ngFor directive in Angular 7



Here is my code that i have tried:



TypeScript:



getPromotions() 
this.dashboardService.getPromotions()
.subscribe(res =>

this.promotions = res.listings.map(res =>
return image: `data:$
res.file_mime_type
;base64,$this.dashboardService.bufferToString(res.file_content.data)`
);


console.log('Promotions::', this.promotions);

, err =>

)



html:



<div class="card">
<div class="card-body">
<ngb-carousel>
<ng-template ngbSlide *ngFor="let promotion of promotions">
<img [src]="promotion.image" height="392" class="d-block w-100" alt="Random slide">
<div class="carousel-caption">
<h3>No Promotion</h3>
<p>There is not active Promotion.</p>
</div>
</ng-template>
</ngb-carousel>
</div>
</div>


This code should show the images in promotions array but it showing nothing.







angular typescript bootstrap-4 carousel ngfor






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 7:40









Nabeel Ahmad KhanNabeel Ahmad Khan

134 bronze badges




134 bronze badges















  • Meaby ngb-carousel load templates only on init, when there is no data inside this.promotions?

    – Patryk Uszyński
    Mar 27 at 7:52











  • @PatrykUszyński i have tried with image with index 0 in the promotions array. and It showing that image. but problem with this for loop i think

    – Nabeel Ahmad Khan
    Mar 27 at 8:06











  • same issue. did u find any solution @NabeelAhmadKhan

    – Gvs Akhil
    May 26 at 13:32

















  • Meaby ngb-carousel load templates only on init, when there is no data inside this.promotions?

    – Patryk Uszyński
    Mar 27 at 7:52











  • @PatrykUszyński i have tried with image with index 0 in the promotions array. and It showing that image. but problem with this for loop i think

    – Nabeel Ahmad Khan
    Mar 27 at 8:06











  • same issue. did u find any solution @NabeelAhmadKhan

    – Gvs Akhil
    May 26 at 13:32
















Meaby ngb-carousel load templates only on init, when there is no data inside this.promotions?

– Patryk Uszyński
Mar 27 at 7:52





Meaby ngb-carousel load templates only on init, when there is no data inside this.promotions?

– Patryk Uszyński
Mar 27 at 7:52













@PatrykUszyński i have tried with image with index 0 in the promotions array. and It showing that image. but problem with this for loop i think

– Nabeel Ahmad Khan
Mar 27 at 8:06





@PatrykUszyński i have tried with image with index 0 in the promotions array. and It showing that image. but problem with this for loop i think

– Nabeel Ahmad Khan
Mar 27 at 8:06













same issue. did u find any solution @NabeelAhmadKhan

– Gvs Akhil
May 26 at 13:32





same issue. did u find any solution @NabeelAhmadKhan

– Gvs Akhil
May 26 at 13:32












0






active

oldest

votes










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/3.0/"u003ecc by-sa 3.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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372038%2fdynamic-carosel-images-not-showing-with-ngfor-angular-7%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372038%2fdynamic-carosel-images-not-showing-with-ngfor-angular-7%23new-answer', 'question_page');

);

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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript