本文整理匯總了TypeScript中services/datasource.DataSource類的典型用法代碼示例。如果您正苦於以下問題:TypeScript DataSource類的具體用法?TypeScript DataSource怎麽用?TypeScript DataSource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了DataSource類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(serviceName: string) {
this.dataSource = Container.instance.get(DataSource);
this.dataService = this.dataSource.getService(serviceName);
}
示例2: constructor
constructor(private bm: BillingsManager, private ds: DataSource) {
this.lbService = ds.getService('leistungsblock')
}
示例3: constructor
constructor(private dc: DialogController, ds: DataSource) {
this.briefeService = ds.getService("briefe");
}
示例4: loginAs
public loginAs(name: string, pwd: string) {
this.ds.login(name, pwd).then(user => {
if (user) {
this.session.setUser(user);
this.router.navigateToRoute("dispatch");
} else {
alert("Interner Fehler: Login misslungen");
}
});
}
示例5: doLogin
public doLogin() {
this.ds.login(this.username, this.password).then(user => {
if (user) {
this.session.setUser(user);
this.router.navigateToRoute("dispatch");
} else {
alert("Username oder Passwort falsch");
}
});
}
示例6:
return this.ds.metadata().then(meta => {
this.testmode = meta.testing;
return this.ds.login().then(user => {
if (user) {
this.session.setUser(user);
return this.router.navigateToRoute("dispatch");
} else {
return true;
}
});
});
示例7: login
public async login(username?: string, pwd?: string, persist?: boolean) {
const user: UserType = await this.ds.login(username, pwd);
if (user) {
user["type"] = "user";
this.we.selectItem(user);
this.currentUser = user;
} else {
this.we.logout();
this.currentUser = undefined;
}
return this.currentUser;
}
示例8: logout
public async logout() {
this.currentUser = undefined;
this.we.logout();
return this.ds.logout();
}