SHARE
TWEET
Untitled
a guest
Apr 10th, 2018
133
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- //HTML
- <div class="form-group">
- <label for="project">Project</label>
- <select name="dev_team_id" [(ngModel)]="dev_team_id" (ngModelChange)="vsiUserjiZaProjekt(dev_team_id)" class="form-control" id="project" name="project">
- <option value="none">Select Project</option>
- <option *ngFor='let project of allProjects' value="{{project._id}}">{{project.title}}</option>
- </select>
- </div>
- //MODULE
- allUsers(id) {
- this.service.getTeam(id)
- .then(data => {
- this.development_team = data;
- }).then(data => console.log(this.development_team));
- }
- //it works with static parameter, passed like this
- allUsers(id) {
- this.service.getTeam('5acc886f8066b119f4aaa0f2')
- .then(data => {
- this.development_team = data;
- }).then(data => console.log(this.development_team));
- }
- //SERVICE
- getTeam(id) {
- var url = this.hostname + '/team/' + id;
- return new Promise(resolve => {
- this.http.get(url)
- .map(res => res.json())
- .subscribe(data => {
- resolve(data);
- });
- });
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
