标签: ionic3

如何在 Ionic 3 中创建具有 + 和 - 按钮的输入框

如何创建一个带有 + 和 - 按钮的输入框。单击哪个用户可以更改所选产品的数量,如此屏幕图像

我知道这个问题之前就在这里,但它不是 ionic3 并且答案不起作用,因为所有值都会增加或减少 <- 这个问题被添加到那里,但没有人回答

ionic-framework ionic3 angular

3
推荐指数
1
解决办法
2838
查看次数

我正在尝试理解内容安全策略框架祖先标签

我正在尝试在 IONIC 应用程序内的 iframe 中显示我的网站之一。我需要限制我的网站被其他网站嵌入框架。我决定使用内容安全策略响应标头,其中

Content-security-policy: frame-ancestors ${website-to-be-allowed}

确保只有提到的网站可以 iframe 我的网站,但是我也需要我的 ionic 应用程序来 iframe 我的网站,并且由于 Ionic 应用程序用作文件系统,我可以将所有文件系统的访问权限授予 iframe 我的网站。当我添加

Content-security-policy: frame-ancestors ${website-to-be-allowed} filesystem

如此处所述, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors

我在 Android 和 IOS 应用程序上进行了测试,并且都抛出了相同的错误,内容如下:

Refused to display ${website} in a frame because an ancestor violates the following content security policy directive: "frame-ancestors filesystem"

这是弹出的错误,在此处输入图像描述

security content-security-policy ionic-framework ionic3

3
推荐指数
1
解决办法
1344
查看次数

Azure Active Directory 的应用程序配置错误错误

我正在我的 ionic 应用程序 3 中实现 Microsoft ADAL 插件,因此我已在 Microsoft azure 上创建了一个帐户,并在 Azure 门户中注册了我的应用程序。在完成所有必要的配置之后,我在我的离子中使用了应用程序凭据,但它通过配置错误。

尽管我正确配置了我的应用程序并授予所有必要的管理权限。我在所有论坛上搜索了这个,但存在错误。

弹出的错误

谢谢

AADSTS650056:应用程序配置错误。这可能是由于以下原因之一造成的: 客户端未在客户端应用程序注册中请求的权限中列出“AAD Graph”的任何权限。或者,管理员未同意租户。或者,检查请求中的应用程序标识符,确保其与配置的客户端应用程序标识符匹配。请联系您的管理员以修复配置或代表租户同意。客户端应用程序 ID:

azure-active-directory adal ionic3 microsoft-graph-api

3
推荐指数
1
解决办法
2万
查看次数

Ionic 2 - Sidemenu中的Logout选项卡

如何在离子2侧面菜单中添加Logout选项卡?如果您已登录,则表明您正在使用DashboardPage.现在我有一个菜单项"Logout",它只是带我到主页.这是app.component.ts中包含所有菜单项的pages数组:

this.pages = [
    {title: 'Dashboard', component: DashboardPage},
    ...
    {title: 'Logout', component: HomePage}
];
Run Code Online (Sandbox Code Playgroud)

但现在我需要在注销后面添加逻辑,而不仅仅是页面切换.当我点击Logout选项卡而不是仅转到HomePage时,是否可以调用函数logout()?

编辑:

这是openPage函数:

openPage(page) {
    this.nav.setRoot(page.component);
}
Run Code Online (Sandbox Code Playgroud)

typescript ionic-framework ionic2 ionic3 angular

2
推荐指数
1
解决办法
6231
查看次数

离子3验证边界未在ios上显示

我正在使用ionic3创建一个登录页面,并进行表单验证.当我运行Android和浏览器平台的应用程序时,验证显示为红色底部边框.但对于ios平台,它底部没有显示红色边框.我错过了什么?

参考屏幕截图ios平台的屏幕截图 - 没有红色边框 安卓平台的secreenshot-显示红色边框

ionic-framework ionic2 ionic3

2
推荐指数
1
解决办法
1314
查看次数

ionic 2 returns {"__ zone_symbol__state":null,"__ zone_symbol__value":"cyprus"}

我在一个名为api-serive.ts的提供者页面中有我的功能

//get city in profile 
    getCityInProfile(){
        return new Promise((resolve, reject) => {

            let headers = new Headers({ 'Authorization':  
             localStorage.getItem('token') });

            this.http.get(this.getProfile,{headers:headers}).subscribe(
                (res) => {
                    console.log (res.json().profile.location)
                    resolve(res.json().profile.location)
                    return  (resolve(res.json().profile.location));
                },(err) => {
                    reject(err);
                }); 
        })

    }
Run Code Online (Sandbox Code Playgroud)

当我在另一个page.ts中调用此函数来获取我的个人资料中的城市时,它会返回:

{ "__zone_symbol__state":空, "__ zone_symbol__value": "塞浦路斯"}

这就是我在page.ts中调用它的方式

CityInProfile(){console.log(JSON.stringify(this.jobsServiceProvider.getCityInProfile())+'return')this.cityProfile = this.jobsServiceProvider.getCityInProfile(); }

价值在那里(塞浦路斯),但为什么它会以这种方式返回

cordova typescript ionic2 ionic3 angular

2
推荐指数
1
解决办法
5590
查看次数

Applozic Ionic为用户获取最后一条消息

在Applozic/Ionic集成应用程序中,我需要为用户或组获取最后的消息和聊天时间

我已经阅读了Applozic - Ionic集成的文档,但还没有找到上面的解决方案.它只在下面提到

//Get Total Unread Count
applozic.getUnreadCount(function(response){
     var count = response;
    },
    function(error){alert(error)
   });
   
//Get Unread count per user
   var userId = 'USER_ID'; //pass UserId with which unread count 
   applozic.getUnreadCountForUser(userId,function(response){
     var count = response;
    },
    function(error){alert(error)
   });
   
 //Get unread count per group
   var groupId = 'GROUP_ID'; // pass groupId in which unreadcount required

  applozic.getUnreadCountForGroup(groupId,function(response){
       var count = response;
    },
     function(error){
    });
Run Code Online (Sandbox Code Playgroud)

chat applozic ionic2 ionic3

2
推荐指数
1
解决办法
480
查看次数

模块解析失败:意外的令牌离子3

升级到离子和离子角度的最新模块后,我得到了这个错误.这是我升级后的Package.json文件..

这是我升级后的Package.json文件..

在此输入图像描述

运行时错误

Module parse failed: Unexpected token (84:1254) You may need an appropriate loader to handle this file type. | HomelistPage = __decorate([ | Component({ | selector: 'page-homelist',template:/*ion-inline-start:"/Users/macbook/Downloads/studio/src/pages/home/homelist/homelist.html"*/`<ion-header>\n <ion-navbar color="bluegray">\n <button ion-button menuToggle color="light">\n <ion-icon name="menu"></ion-icon>\n </button>\n <ion-title color="light">Instractors</ion-title>\n <ion-buttons right>\n <button color="light" ion-button icon-only (click)="createMessage()">\n <ion-icon name="more"></ion-icon>\n </button>\n </ion-buttons>\n </ion-navbar>\n <ion-toolbar color="bluegray">\n <ion-searchbar></ion-searchbar>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n <!--*********** 2 colomns list ***********-->\n <ion-grid>\n <ion-row wrap>\n <ion-col tappable col-6 *ngFor="let item of items" (click)="goToDetail(item.$key)" color="gray">\n <ion-card class="cardList">\n <div *ngIf="item.discount" class="ribbon pop-in">SALE</div>\n <img …
Run Code Online (Sandbox Code Playgroud)

javascript firebase-realtime-database ionic3

2
推荐指数
1
解决办法
1829
查看次数

将ID保存到Firestore文档

我也想将文档的ID另存为一个属性,而不仅仅是作为集合的引用。目前,我这样保存它:

const newSet: AngularFirestoreDocument<SetModel> = this.AngularFirestore.doc('users/' + this.navParams.data.userId);

    // adding user to our ddbb
    newSet.collection('sets').add(this.set)
      .then(function (docRef) {
        // ok
      })
      .catch(function (error) {
        // error
      });
Run Code Online (Sandbox Code Playgroud)

那可能吗?还是我需要保存它,获取ID并再次更新?

PS这是我的ddbb结构: 在此处输入图片说明

在此处输入图片说明

firebase ionic3 angular google-cloud-firestore

2
推荐指数
2
解决办法
3396
查看次数

如何获取离子3中的离子复选框多个选择值

    <div *ngIf="testList.length > 0">
  <ion-item *ngFor="let member of testList">
    <ion-label>{{member?.testName || 'N/A'}}</ion-label>
    <ion-checkbox color="dark" [(ngModel)]="member.checked"></ion-checkbox>
  </ion-item>
</div>

[{testID: 1, testName: " test1", testAmount: "500", testDescription: ""},
{testID: 2, testName: " test2", testAmount: "500", testDescription: ""},
{testID: 3, testName: "dgdfgd", testAmount: "150", testDescription: ""},
{testID: 4, testName: "UricAcid", testAmount: "200", testDescription: ""}]

<button (click)="gettstdata()">Done</button>
Run Code Online (Sandbox Code Playgroud)

单击“完成”按钮时如何获取所有复选框值(例如多选)

ionic-framework ionic3 angular ion-checkbox

2
推荐指数
3
解决办法
1万
查看次数