constructor(private _FileService: FileService) {
        this.map = new ol.Map({
            layers: [
                new ol.layer.Tile({
                    source: new ol.source.OSM()
                })
            ],
            target: 'map',
            controls: ol.control.defaults({
                attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
                    collapsible: false
                })
            }),
            view: new ol.View({
                center: [0, 0],
                zoom: 2
            })
        });
        this.map.renderSync();
    }



And this is the div, added to the component 

    <div id="map" class = "map" tabindex="0"></div>
<script>
    console.log('got here');
    map.renderSync();
</script>