Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:07
    gustadsg starred angular/angular
  • 17:06
    FranMahon starred angular/angular
  • 17:00
    csisy commented #48878
  • 16:59
    ngbot[bot] milestoned #48878
  • 16:59
    alan-agius4 labeled #48878
  • 16:59
    alan-agius4 labeled #48878
  • 16:59
    alan-agius4 edited #48878
  • 16:59
    csisy opened #48878
  • 16:41
    EdsonAmaya7 starred angular/angular
  • 12:45
    kirillbb starred angular/angular
  • 12:30
    vladwizard starred angular/angular
  • 10:07
    angular-robot synchronize #48248
  • 10:07
    angular-robot edited #46728
  • 10:05
    pullapprove[bot] review_requested #48877
  • 10:05
    ngbot[bot] milestoned #48877
  • 10:05
    ngbot[bot] milestoned #48877
  • 10:05
    angular-robot labeled #48877
  • 10:05
    angular-robot labeled #48877
  • 10:05
    angular-robot labeled #48877
Rob Wormald
@robwormald
its async
YogeshChoudhari
@YogeshChoudhari
everyting is set up properly
Rob Wormald
@robwormald
like promises
are you doing this in a service?
YogeshChoudhari
@YogeshChoudhari
i have creates one json file friend.json
trying to read that using htt.get method
yes service
Rob Wormald
@robwormald
post the relevant code https://gist.github.com/
but you should return the request, and subscribe in the component, typically
YogeshChoudhari
@YogeshChoudhari
like how
did i wort wrong in service
Rob Wormald
@robwormald
class SomeService {
  constructor(private http: Http){}
  doStuff(){
    return this.http.get(url).map(res => res.json());
  }
}
class SomeComponent {
  constructor(someService: SomeService){
    someService.doStuff().subscribe(...)
  }
}
YogeshChoudhari
@YogeshChoudhari
YogeshChoudhari/hero-service.ts
add on this location
ill try this
let me check
should i add index.html and friend.json too
sorry not add
code is added on location
Rob Wormald
@robwormald
what?
YogeshChoudhari
@YogeshChoudhari
Rob i am trying your solution
Rob Wormald
@robwormald
yeah. dont subscribe in the service
see the snippet above ^
YogeshChoudhari
@YogeshChoudhari
yes trying that
Hi Rob
I am adding my app.componant.ts file to can you please check that also
YogeshChoudhari
@YogeshChoudhari
can you please check my uploaded files
Rob Wormald
@robwormald
don't subscribe in the service
YogeshChoudhari
@YogeshChoudhari
than how i'll get data
can you please help me
Rob Wormald
@robwormald
subscribe in the component...
YogeshChoudhari
@YogeshChoudhari
yes is did same
read that closely
YogeshChoudhari
@YogeshChoudhari

export class AppComponent implements OnInit{
public selectedHero: Hero;
public heroes: Hero[];
result: Object;

constructor(private _heroService: HeroService) { }

onSelect(hero: Hero) { this.selectedHero = hero; }

ngOnInit() {
this.getHeroes();
this.getFriends();

}

getHeroes() {

    this._heroService.getHeroes().then(heroes => this.heroes = heroes);

}
getFriends(){
this.result = {friends:[]};
this.result =this._heroService.loadFriendsSuccessFully().subscribe(res => this.result = res);
}
}

same think i did
but still it showing 304 status in fiddler
YogeshChoudhari
@YogeshChoudhari
wow
thanks let me try this
Jayaram Kannan
@Kannaj
hello - i have a project which requires a basic file upload and a webrtc feature. Aside from that - there arent many real-time features provided for the user. I'm confused as to what front end framework i should use. Would something like angular be considered overkill for such an app. I am confused between going angular or backbone/react
Daniel
@gaiottino
What's happened to filter and orderBy? These are pipes that haven't been ported to ng2?
Vlado Tesanovic
@vladotesanovic
@gaiottino No, you must create it on your own.
Louis
@Louis-7
Hi
Anyone know how to get pure HTML in Angular2? When I want to get get parent HTML, there are always some angular selector in it. It's not pure.
Rob Wormald
@robwormald
the question would be why?
Louis
@Louis-7
no, the question is how to get the pure HTML