[AngularJS] data binding problem with ng-template?

2018-08-02 Thread Sampath Tharanga




Hi guys, 
Please help me solve this problem. How can solve this problem? how can 
parse data  "container " to "ng-template #leftNode". Give me some advice.

html code here


   
   
   


   
   
   






   
   
   {{ 
actress.presentYear }}
   
   {{ actress.name }}
{{ actress.description }}
   read more
   
   


   
   
   
   
   
   {{ actress.name }}
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   





   
   
   
   {{ 
actress.presentYear }}
   
   {{ actress.name }}
{{ actress.description }}
   read more
   
   


   
   
   
   
   
   {{ actress.name }}
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   


TypeScript code here
import { Component, OnInit } from '@angular/core';

@Component({
 selector: 'app-content-section',
 templateUrl: './content-section.component.html',
 styleUrls: ['./content-section.component.css']
})
export class ContentSectionComponent implements OnInit {

  actresses: Object[];
 constructor() {
this.actresses = [
 {
   classType: "left",
   presentYear: "Tamil Actress | 2013–present",
   name: "Meghali",
   description: "Meghali is an Indian actress who has appeared in Tamil 
cinema . She will make her Tamil debut in P. Vijay's upcoming film ...",
   readmoreUrl: "https://en.wikipedia.org/wiki/Meghali;,
   photoUrl: 
"https://i.pinimg.com/originals/3d/b6/41/3db6412a68e022a4ed39cdd97b43fb93.jpg;
 },
 {
   classType: "left",
   presentYear: "Hindi Actress | 2007–present",
   name: "Meghali",
   description: "Meghali is an Indian actress who has appeared in Tamil 
cinema . She will make her Tamil debut in P. Vijay's upcoming film ...",
   readmoreUrl: "https://en.wikipedia.org/wiki/Meghali;,
   photoUrl: 
"https://i.pinimg.com/originals/61/80/7c/61807c06d3c73d66392f55210ecc1752.jpg;
 },
 {
   classType: "left",
   presentYear: "Tamil Actress | 2013–present",
   name: "Meghali",
   description: "Meghali is an Indian actress who has appeared in Tamil 
cinema . She will make her Tamil debut in P. Vijay's upcoming film ...",
   readmoreUrl: "https://en.wikipedia.org/wiki/Meghali;,
   photoUrl: 
"https://i.pinimg.com/originals/3d/b6/41/3db6412a68e022a4ed39cdd97b43fb93.jpg;
 },
 {
   classType: "left",
   presentYear: "Hindi Actress | 2007–present",
   name: "Meghali",
   description: "Meghali is an Indian actress who has appeared in Tamil 
cinema . She will make her Tamil debut in P. Vijay's upcoming film ...",
   readmoreUrl: "https://en.wikipedia.org/wiki/Meghali;,
   photoUrl: 
"https://i.pinimg.com/originals/61/80/7c/61807c06d3c73d66392f55210ecc1752.jpg;
 },
 {
   classType: "left",
   presentYear: "Tamil Actress | 2013–present",
   name: "Meghali",
   description: "Meghali is an Indian actress who has appeared in Tamil 
cinema . She will make her Tamil debut in P. Vijay's upcoming film ...",
   readmoreUrl: "https://en.wikipedia.org/wiki/Meghali;,
   photoUrl: 
"https://i.pinimg.com/originals/3d/b6/41/3db6412a68e022a4ed39cdd97b43fb93.jpg;
 },
 {
   classType: "left",
   presentYear: "Hindi Actress | 2007–present",
   name: "Meghali",
   description: "Meghali is an Indian actress who has appeared in Tamil 
cinema . She will make her Tamil debut in P. Vijay's upcoming film ...",
   readmoreUrl: "https://en.wikipedia.org/wiki/Meghali;,
   photoUrl: 
"https://i.pinimg.com/originals/61/80/7c/61807c06d3c73d66392f55210ecc1752.jpg;
 }
   ];
  }

   state = true;
 ngOnInit() {
 }

}



Error Here



-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" 

[AngularJS] Angular 9 with HTTP use?

2020-04-21 Thread Sampath Tharanga

Hi,

I'm a beginner with Angular9. So, I need to display data with coming to 
HTTP url(GET API link). Please help me to solve this problem.

Here my code, It's wrong. Help me to solve this.

import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { map, catchError} from 'rxjs/operators';

interface Course {
description: string;
courseListIcon:string;
iconUrl:string;
longDescription:string;
url:string;
}

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})

export class AppComponent {
courses$: Observable;

constructor(private http:HttpClient) {
}

ngOnInit() {
this.courses$ = this.http
.get("https://xx;) 
// HERE URL
.map(data => _.values(data))
.do(console.log);
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/d709fb9e-4df6-41ca-8d00-31b0aee63078%40googlegroups.com.