Re: [AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-08 Thread Rich Leach
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

Re: [AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-08 Thread Zlatko Đurić
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

Re: [AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread Rich Leach
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

Re: [AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread Zlatko Đurić
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"

Re: [AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread 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() {

Re: [AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread 'Lucas Lacroix' via Angular and AngularJS discussion
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

[AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread Arnaud Deman
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/

[AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread Rich Leach
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

[AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread Arnaud Deman
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

[AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread Zlatko Đurić
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 :

[AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread Arnaud Deman
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 :

[AngularJS] Re: n00b question: concatenating string using 2 way binding

2017-11-07 Thread Zlatko Đurić
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