本文整理汇总了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();
}