i currently create a angular 2 app, but i ran into problems with QueryList. How do i manage to get values out of it? I get the querylist with: @ViewChildren('setSlider') setSliders: QueryList ; This part works fine so far. Now i got this object: QueryList {_dirty: false, _results: Array[4], _emitter: EventEmitter} And now.. i just want to get the second result from it. For Example: setSliders[0] ---> dont work. Whats the best way to do that? thanks a lot :) Solved There are a few ways to do so. Check out API docs on Angular2 site: https://angular.io/docs/ts/latest/api/core/index/QueryList-class.html The simplest way: let secondSlide = this.setSliders.toArray()[2] You can use this too. ngAfterViewInit() { console.log(this.setSliders.toArray()); this.setSliders.changes.subscribe(val => console.log(this.setSliders.toArray()); } try using the map method: this.setSliders.map( slider => console.log(...
I have a webpacked client application running on localhost:8080 and an Silex PHP application running with apache on localhost:80 I try to send a PUT request with axios on the client to the silex application with a request payload. But somehow in the silex application I see no payload, the request parameters bag is empty. This is my vHost CORS config: Header always set Access-Control-Allow-Origin "http://localhost:8080" Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" Header always set Access-Control-Max-Age "1000" Header always set Access-Control-Allow-Headers "x-requested-with, x-requested-by, Content-Type, origin, authorization, accept, client-security-token" # Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request. RewriteEngine On RewriteCond %{REQUEST_METHOD} OPTIONS RewriteRule ^(.*)$ $1 [R=200,L] And these are the request and response headers. I really don't know what is miss...