打字稿编译器错误 - 提供的参数不匹配呼叫目标的任何签名 [英] Typescript compiler error - supplied parameters do not match any signature of call target

查看:638
本文介绍了打字稿编译器错误 - 提供的参数不匹配呼叫目标的任何签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

打字稿编译器 - 提供的参数不匹配呼叫目标的任何签名

Typescript compiler - supplied parameters do not match any signature of call target.

我创建带有打字稿的angular2应用程序。
当我安装实例火力它给我的混帐bash命令行这个错误:提供的参数不匹配呼叫目标的任何签名

I'm creating an angular2 app with typescript. When I setup instance to firebase it gives me this error in the git bash command line: "supplied parameters do not match any signature of call target".

其抱怨这一行$ C $的c那么它说:

Its complaining about this line of code it says:

this.data =新AngularFire(新火力地堡( https://markng2.firebaseio.com/用户'));

this.data = new AngularFire(new Firebase('https://markng2.firebaseio.com/users'));

这是code为app.ts文件:

This is the code for the app.ts file:

   import {Component, View, bootstrap, bind, provide} from 'angular2/angular2';
   import {Router, ROUTER_BINDINGS, RouterOutlet, RouteConfig, RouterLink, ROUTER_PROVIDERS, APP_BASE_HREF} from 'angular2/router';
   import {Injectable} from 'angular2/angular2';
   import {HTTP_PROVIDERS, Http, Headers} from 'angular2/http';

   import {Todo} from './components/todo/todo';
   import {About} from './components/about/about';
   import {AuthService} from './authService';
   import {EnvironmentService} from './environmentService';

   import {AngularFire, FirebaseArray} from '../firebase/angularfire';

   @Component({
           selector: 'app'
   })

   @View({
       template: `
           <div class="container">
               <nav>
                <ul>
                    <li><a [router-link]="['/Home']">Todo</a></li>
                    <li><a [router-link]="['/About']">About</a></li>
                   </ul>
               </nav>
            <router-outlet></router-outlet>
           </div>
        `,
       directives: [RouterOutlet, RouterLink]
   })

   @RouteConfig([
    { path: '/', redirectTo: '/home' },
    { path: '/home', component: Todo, as: 'Home' },
    { path: '/about', component: About, as: 'About' }
   ])

   @Injectable()
   export class AppComponent {
       store:FirebaseArray;
       data: AngularFire;

       constructor(_router: Router, _authService: AuthService){ 

           //Firebase setup - Here the line below seems to be the issue???:
           this.data = new AngularFire(new Firebase('https://markng2.firebaseio.com/users'));
           this.store = this.data.asArray();        

           _router.subscribe((val) => {     

               _authService.isUserLoggedIn().then((success) => {    
                   if(!success){                    
                       _router.navigate(['/About']);
                   }else{
                       _authService.getSpotifyData().then((success) => {    
                           console.log(success);                        
                       });  
                   } 
               });  
           })
       }
   }

   bootstrap(AppComponent, [ROUTER_PROVIDERS, provide(APP_BASE_HREF, {useValue: '/'}), HTTP_PROVIDERS, AuthService, EnvironmentService]);

这是Git的bash命令错误:

在这里输入的形象描述

推荐答案

我觉得这里的困惑是,有没有对角AngularFire 2现在。

I think the confusion here is that there is no AngularFire for Angular 2 right now.

目前AngularFire 1.0+不与角2兼容这是AngularJS 1.2+只。

The current AngularFire 1.0+ is not compatible with Angular 2. It's AngularJS 1.2+ only.

这AngularFire为角2 是我的东西写了这个presentation 。这不是正式支持。

This AngularFire for Angular 2 is something I wrote for this presentation. It's not officially supported.

虽然是火力地堡和2角,此时没有正式的集成,火力地堡SDK工作完全正常,由于zone.js的神奇。

While there is no official integration with Firebase and Angular 2 at this time, The Firebase SDK works perfectly fine due to the magic of zone.js.

这篇关于打字稿编译器错误 - 提供的参数不匹配呼叫目标的任何签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆