@@ -91,7 +91,7 @@ main-page.xml
9191
9292 ...
9393
94- <Facebook : LoginButton onLogin =" {{ onLogin }}" ></Facebook : LoginButton >
94+ <Facebook : LoginButton login =" {{ onLogin }}" ></Facebook : LoginButton >
9595
9696 ...
9797
@@ -101,7 +101,6 @@ main-page.xml
101101main-view-model.ts
102102``` TypeScript
103103import { Observable } from ' data/observable' ;
104- let Facebook = require (' nativescript-facebook' );
105104
106105export class HelloWorldModel extends Observable {
107106
@@ -131,14 +130,12 @@ main-page.xml
131130main-view-model.ts
132131``` TypeScript
133132import { Observable } from ' data/observable' ;
134- let Facebook = require ( ' nativescript-facebook' ) ;
133+ import { login } from " nativescript-facebook" ;
135134
136135export class HelloWorldModel extends Observable {
137136
138137 public testAction() {
139- Facebook .login ((error , data ) => {
140- console .log (" Success!" );
141- });
138+ login ((error , data ) => console .log (" Success!" ));
142139 }
143140
144141}
@@ -167,7 +164,7 @@ application.on(application.launchEvent, function (args) {
167164app.component.html
168165``` html
169166<StackLayout >
170- <FacebookLoginButton [onLogin ] =" onLogin" ></FacebookLoginButton >
167+ <FacebookLoginButton [login ] =" onLogin" ></FacebookLoginButton >
171168</StackLayout >
172169```
173170
@@ -198,7 +195,7 @@ app.component.html
198195app.component.ts
199196``` TypeScript
200197import { Component } from " @angular/core" ;
201- import { LoginResponse } from " nativescript-facebook" ;
198+ import * as Facebook from " nativescript-facebook" ;
202199
203200@Component ({
204201 selector: " ns-app" ,
0 commit comments