-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suppress compile error #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,13 @@ | |
|
||
// This sample is TypeScript ported version of https://github.com/firebase/quickstart-js. | ||
|
||
/// <reference path="../../../node_modules/firebase/app.d.ts" /> | ||
/// <reference path="../../../node_modules/firebase/firebase.d.ts" /> | ||
|
||
import * as firebase from 'firebase'; | ||
|
||
const config = { | ||
apiKey: "<apiKey>", | ||
authDomain: "<domain>", | ||
databaseURL: "<database URL>", | ||
storageBucket: "<storage bucket>" | ||
storageBucket: "<storage bucket>", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as you like. |
||
}; | ||
|
||
firebase.initializeApp(config); | ||
|
@@ -34,10 +31,10 @@ function toggleSignIn() { | |
if (firebase.auth().currentUser) { | ||
firebase.auth().signOut(); | ||
} else { | ||
const email = (<HTMLInputElement>document.getElementById('email')).value; | ||
const email = (document.getElementById('email') as HTMLInputElement).value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as you like. |
||
const password = (<HTMLInputElement>document.getElementById('password')).value; | ||
firebase.auth().createUserWithEmailAndPassword(email, password) | ||
.catch((e) => { | ||
.catch((e: firebase.FirebaseError) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should make up type annotation manually. |
||
const code = e.code; | ||
const message = e.message; | ||
|
||
|
@@ -67,7 +64,7 @@ function handleSignUp() { | |
return; | ||
} | ||
firebase.auth().createUserWithEmailAndPassword(email, password) | ||
.catch((e) => { | ||
.catch((e: firebase.FirebaseError) => { | ||
const code = e.code; | ||
const message = e.message; | ||
switch (code) { | ||
|
@@ -82,4 +79,4 @@ function handleSignUp() { | |
}) | ||
}; | ||
|
||
// port initApp() | ||
// port initApp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this lines is not required.
tsc can lookup these definition files. see
cat node_modules/firebase/package.json | grep types
.http://qiita.com/vvakame/items/72d22e33632178f7db24