本文整理匯總了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');
});
}