It doesn’t work for me. .
임종식
1

Here is my angualr2 code

import { Component, OnInit } from '@angular/core';
import {ngSelectLocation, EmitterService} from '../ng2-location/browser-location';
@Component({
selector: 'app-geo',
styleUrls: ['./geo.component.css'],
providers:[EmitterService],
directives: [ngSelectLocation],
template: '<ngLocation></ngLocation>'
})
export class GeoComponent implements OnInit {
public selectedCity:any;
constructor(private EmitterService: EmitterService) {
window.localStorage.removeItem("city");
}
ngOnInit(){
this.selectedCity = localStorage.getItem('city');
EmitterService.get("selectedCity").subscribe(data =>{
this.selectedCity = data;
localStorage.setItem('city', data);
});
}
}
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.