我正在尝试在多个页面中添加自定义组件。
ionic g pages nameionic g component name此时我只是尝试这个:
<ion-content>
<app-menu-button></app-menu-button>
</ion-content>
Run Code Online (Sandbox Code Playgroud)
app-menu-button 是组件选择器
我收到此错误:1. If 'app-menu-button' is an Angular component, then verify that it is part of this module.
我尝试在我的应用程序模块文件中添加以下内容:
exports: [
MenuButtonComponent
]
Run Code Online (Sandbox Code Playgroud)
但这不起作用。
我的目标是在多个页面中显示该组件。
谢谢,
I'm working on Ionic v4 with Angular.
In my project i use the BLE to communicate with a raspberry.
I have several step :
Currently i have something like :
this.ble.scan().subscribe(result => {
if (device === theDeviceIWant) {
this.ble.connect(device.id).subscribe(result => {
this.ble.startNotification(infosaboutDevice).subscribe(result => {
// Message 1
this.ble.writeWithoutResponse(infos, message).then(result => {
// Message 2
this.ble.writeWithoutResponse(infos, message).then(result => {
// Message 3
this.ble.writeWithoutResponse(infos, message).then(result => {
// Message X …Run Code Online (Sandbox Code Playgroud)