2017-01-18 6 views
0

나는 사회적으로 기초한 맞춤형 인증을 구현하려고한다. tutorial. 내가 그것을 실행하려고하면 또한 Meteor + Angular2 auth issue

import { Component } from "@angular/core"; 

import template from "./app.component.html"; 
import style from "./app.component.scss"; 

import { InjectUser } from "angular2-meteor-accounts-ui"; 

@Component({ 
    selector: "app", 
    template, 
    styles: [style] 
}) 
@InjectUser('user') 
export class AppComponent { 
    constructor() { 

    } 

    logout() { 
     Meteor.logout(); 
    } 
} 

자습서 응용 프로그램 step19 다운로드 한 파일이 오류가 발생합니다 : 나는 아래, InjectUser 데코레이터 을 추가 할 때

내 응용 프로그램이 작동을 멈 춥니 다.

이 문제를 어떻게 해결할 수 있습니까? 또는 어떻게 사용자 정의 로그인을 만들 수 있습니까?

답변

0

@InjectUser('user')은 html 부분의 사용자 모음 액세스 용으로 추가되었습니다. 그리고 당신이 AppComponent에서 한 줄을 놓치고 있다고 생각합니다.

user: Meteor.User; 

주입 한 사용자를 선언하고 plz이받는 오류를 알려주십시오. 나는 당신의 실수가 뭔가 다른 것을 발견하면 내 대답을 편집 할 것입니다.

+0

이 자습서는 다음과 같습니다. https://angular-meteor.com/tutorials/socially/angular2/angular-material-and-custom-angular-auth-forms 콘솔에 오류가 표시되지 않습니다. . –