stackblitz

Reading data.json with HttpClient on Stackblitz?

拜拜、爱过 提交于 2019-12-02 05:07:48
问题 I have a tiny demo and it attempts to read app/data.json using the Angular HttpClient. const post$:Observable<Post> = <Observable<Post>> http.get('./data.json'); However the HttpClient reponse says: Failure during parsing ... Thoughts? 回答1: Stackblitz currently doesn't serve static files except the case when they are in assets folder. So you have two options here: 1) Import json directly as module import data from './data.json'; console.log(data) // => {title: "Simulating HTTP Requsts",

Reading data.json with HttpClient on Stackblitz?

[亡魂溺海] 提交于 2019-12-02 00:35:31
I have a tiny demo and it attempts to read app/data.json using the Angular HttpClient. const post$:Observable<Post> = <Observable<Post>> http.get('./data.json'); However the HttpClient reponse says: Failure during parsing ... Thoughts? Stackblitz currently doesn't serve static files except the case when they are in assets folder. So you have two options here: 1) Import json directly as module import data from './data.json'; console.log(data) // => {title: "Simulating HTTP Requsts", content: "This is off the hook!!"} For more details See other answers 2) Move that json in assets folder( Note :

How to downgrade the dependencies for npm packages in StackBlitz?

主宰稳场 提交于 2019-12-01 04:28:33
I'm trying to create an app for demo propose on StackBlitz and must use Angular 5.2.x because my app is still using 5.2.x. I just can't downgrade from v6 to v5.2 when I try to install the dependencies. I actually need e.g. "@angular/common": "^5.2.10", "rxjs": "^5.5.10", "@angular/http": "^5.2.10" etc. But it just force me to install the v6. Is there a possibilities to avoid this and install the needed versions or there is no way? Have been checking the doc for Stackblitz, but didn't find something talking about such case. Delete the existing package by clicking the trash can when hovering

Send and Get data from code editor like Plunker/StackBlitz embedded

拟墨画扇 提交于 2019-11-30 17:11:32
问题 I have a website in .Net Core 2 and Angular 6. I am trying to create a code editor in angular or javaScript that will interact with part of the website, from parent to embeded direction, not the opposite and this code can be submitted to my server once it is done. Can be any other editor that like jsfiddle , jsbin , etc... So I tough about the image below. I would like to embed something similar to Plunker Editor on my website and in this page there will be events that will be sent to this