本文整理汇总了TypeScript中app/components/config/database.ts.Database.getHeaders方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ts.Database.getHeaders方法的具体用法?TypeScript ts.Database.getHeaders怎么用?TypeScript ts.Database.getHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app/components/config/database.ts.Database
的用法示例。
在下文中一共展示了ts.Database.getHeaders方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getUzytkownik
static getUzytkownik(http: Http, id: number) {
var db = Database.db;
var query = id;
return http.get(db + query, {
headers: Database.getHeaders()
})
.map((res: any) => {
let data = res.json();
if (data != null) {
return LekarzFactory.fetchObject(data);
}
return null;
});
}
示例2: getUzytkownikByLogin
static getUzytkownikByLogin(http: Http, login:String)
{
let db = Database.db;
let query = sprintf('_design/users/_view/getUserByLogin?key=["%1$s"]', login);
return http.get(db + query, {
headers: Database.getHeaders()
})
.map((res: any) => {
let data = res.json();
if (data.rows.length > 0) {
return false;
}
return true;
});
}
示例3: getWizytyPacjenta
static getWizytyPacjenta(http: Http, id_pacjenta:String) {
let db = Database.db;
let query = sprintf('_design/users/_view/getWizytyPacjenta?key="%1$s"', id_pacjenta);
return http.get(db + query, {
headers: Database.getHeaders()
})
.map((res: any) => {
let data = res.json();
let wizyty: Array = new Array();
if (data != null) {
let ilosc = data.rows.length;
for (var i = 0; i < ilosc; i++)
{
wizyty[i] = WizytaFactory.fetchObject(data.rows[i].value);
}
return wizyty;
}
return null;
});
}
示例4: getPacjenciLista
static getPacjenciLista(http: Http) {
var db = Database.db;
var query = "_design/users/_view/pacjenci_lista";
return http.get(db + query, {
headers: Database.getHeaders()
})
.map((res: any) => {
let data = res.json();
let pacjenci: Array = new Array();
if (data != null) {
let ilosc = data.total_rows;
for (var i = 0; i < ilosc; i++) {
pacjenci[i] = PacjentFactory.fetchObject(data.rows[i].value);
}
return pacjenci;
}
return null;
});
}
示例5: getIdUzytkownikaByLoginAndHaslo
static getIdUzytkownikaByLoginAndHaslo(http: Http, uzytkownik: Uzytkownik): number {
let db = Database.db;
let query = sprintf('_design/users/_view/getUser?key=["%1$s","%2$s"]', uzytkownik.getLogin(), uzytkownik.getHaslo());
return http.get(db + query, {
headers: Database.getHeaders()
})
.map((res: any) => {
let data = res.json();
console.log(data.rows.length);
if (data.rows.length > 0) {
let uz: Uzytkownik = new Uzytkownik();
uz.setId(data.rows[0].id);
uz.setTypUzytkownika(data.rows[0].value);
return uz;
}
return Rx.Observable.throw('authentication failure');
});
}