在Ionic2项目中包含Plaid-link?

时间:2017-03-04 00:34:24

标签: angular typescript ionic2 cdn plaid

我想在Ionic 2项目中使用Plaid Link。根据在网络和documentation上使用它的经验,您似乎只需安装

<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>

在index.html的主体中,您已准备好使用项目中随处可用的Plaid对象。当我在Ionic 2项目中执行此操作并尝试调用Plaid时,我收到消息: “找不到名字'格子'”。

我的index.html:

<head>
<meta charset="UTF-8">
  <title>Ionic App</title>
  <script src="cordova.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">
  <link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
  <link rel="manifest" href="manifest.json">
  <meta name="theme-color" content="#4e8ef7">
  <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en"></script>
<link href="build/main.css" rel="stylesheet">
</head>

<body>
   <ion-app></ion-app>
   <script src="build/polyfills.js"></script>
   <script src="build/main.js"></script>
   <script src="https://cdn.plaid.com/link/stable/link-initialize.js"></script>
</body>

example.js我尝试调用时使用Plaid对象并得到上述错误:

@Component({
  selector: 'someClass',
  templateUrl: 'someClass.html'
})
export class someClass  {
   usePlaid(): any{
    Plaid.create({...})
   }

}

0 个答案:

没有答案