So clearly there's something in the way I'm trying to display my code
that's not working, as I've tried displaying the data {{data.companyName}}
simply didn't work for me, I'll review that and find the err of my ways
Results
{{ data.companyName }}
{{ data | json }}
I can see I have
On Wednesday, November 8, 2017 at 2:07:43 AM UTC+1, Rich Leach wrote:
>
> LOL
>
> ... you would think this would be something easy
>
> {{data[0].companyName}} is not working, nothing gets returned (no errors
> either).
>
> I've included the returned json below (copied directly from the
LOL
... you would think this would be something easy
{{data[0].companyName}} is not working, nothing gets returned (no errors
either).
I've included the returned json below (copied directly from the console).
In my service call I'm actually calling "... response.json()" so I'm not
sure
Well, if it's aan array, you will have to do something like
dara[0].companyName.
What does your json look like?
Also, use data?.companyName in the template, so that it doesn't break if
your data is undefined, like when you're getting the quote.
On Nov 8, 2017 1:35 AM, "Rich Leach"
Thank you! This is so helpful as I learn Angular
Everything is now working except for when I want to print the results to
the screen instead of just logging to the console I made the following
changes to the app.component.ts file:
onGetStock() {
You've bound your input element to the "tickersymbol" variable. Angular
will make sure that when the user modifies the input that the member
variable on the instance of the component will also be updated.
So, here is what you can do:
*component.TS*
// Note: remove tickersymbolback and
Hi,
I try again ;)
I think the interpolation i.e. : '{{tickersymbol}}' can be used in the
template not in the component.
In the component you could use this kind of string :
let apicall: string=`https://api.iextrading.com/1.0/stock/
Thank you for your help!
I think the larger question is, how do I actually parse, and pass, the
string (that will represent the actual URL to my web service) from my .html
form and into my .ts component (to ultimately inject into the service)?
I've been targeting the strategy of trying to
Hi Zlatko,
*Yes you are right,* my english is not very strong and I missed that in the
docs !
Thanks,
Arnaud.
Le mardi 7 novembre 2017 09:25:22 UTC+1, Zlatko Đurić a écrit :
>
> Hey Arnaud,
>
> On 07.11.2017 09:15, Arnaud Deman wrote:
>
>
>
> In the associated component you just need something
Hey Arnaud,
On 07.11.2017 09:15, Arnaud Deman wrote:
In the associated component you just need something like :
@Input() tikersymbol: string;
As you use two way binding the value will be updated when the user enter a
value.
Here is the angular doc :
Hello Rich,
I am not an angular expert but I think your template is correct.
In the associated component you just need something like :
@Input() tikersymbol: string;
As you use two way binding the value will be updated when the user enter a
value.
Here is the angular doc :
If it's a template-driven form, your component would have a property named
that.
E.g.
export class MyComponent {
tickersymbol:string;
// later in the code...
getQuote() {
this.myService.getQuote(this.tickerSymbol).subscribe();
}
}
On Tuesday, November 7, 2017 at 2:13:10 AM
12 matches
Mail list logo