您好,我想切换一个特定面板,但如果我单击该按钮,其他对象的面板将打开。我怎样才能打开点击的面板?
切换组件.ts
opened:Boolean=false;
toggle () {
this.opened = !this.opened;
}
Run Code Online (Sandbox Code Playgroud)
超文本标记语言
<div class="main" *ngFor="let x of data; let i=index;">
<footer>
<div class="icons">
<span id="{{item.id}}" (click)="toggle()">6<i class="fa fa-users {{i}}" ></i></span>
<span >6<i class="glyphicon glyphicon-picture"></i></span>
<span >6<i class="glyphicon glyphicon-tag"></i></span>
<div class="iconsRight pull-right">
<span >EXIF<i class="glyphicon glyphicon-info-sign"></i></span>
<span ><i class="fa fa-map-marker"></i></span>
<span ><i class="fa fa-share-alt-square"></i></span>
</div>
</div>
</footer>
<div class="togglePanel{{item.id}}" *ngIf="opened" >
<hr/>
<ul class="toggleWrapper">
<li>YES</li>
<hr/>
<li>YES</li>
<hr/>
<li>YES</li>
<hr/>
<li>YES</li>
</ul>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我正在使用库ng2-mqtt,我在我的组件中使用它是这样的:
import 'ng2-mqtt/mqttws31.js';
declare var Paho: any;
Run Code Online (Sandbox Code Playgroud)
现在我收到以下错误:
Run Code Online (Sandbox Code Playgroud)ReferenceError: window is not defined at Object.<anonymous> (/Users/Picchu/Documents/em3/node_modules/ng2-mqtt/mqttws31.js:2143:4) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object.<anonymous> (/Users/Picchu/Documents/em3/dist/server.js:18707:18)
我该如何解决这个问题?
我的网站使用谷歌地图,但我无法在地图上看到全屏功能。如何激活以及为什么我看不到它?
我在地图上添加了以下选项:
var map = new google.maps.Map(document.getElementById('googleMap'), {
zoom: 7,
center: new google.maps.LatLng(this.coordinates[0][1], this.coordinates[0][0]),
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoomControl: true,
scaleControl: true,
zoomControlOptions: {
position: google.maps.ControlPosition.LEFT_TOP
}
});
Run Code Online (Sandbox Code Playgroud)