Format.
This commit is contained in:
parent
1f5d4980e5
commit
4f090a22df
@ -21,7 +21,7 @@ export class ScheduleComponent {
|
|||||||
private $modal
|
private $modal
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
$onInit = function() {
|
$onInit() {
|
||||||
// Load operations on controller initialization.
|
// Load operations on controller initialization.
|
||||||
this.load();
|
this.load();
|
||||||
}
|
}
|
||||||
@ -29,7 +29,7 @@ export class ScheduleComponent {
|
|||||||
/*
|
/*
|
||||||
* Add a new operation at the beginning of th array.
|
* Add a new operation at the beginning of th array.
|
||||||
*/
|
*/
|
||||||
add = function() {
|
add() {
|
||||||
var schedule = new Schedule();
|
var schedule = new Schedule();
|
||||||
schedule.account_id = this.accountId;
|
schedule.account_id = this.accountId;
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ export class ScheduleComponent {
|
|||||||
/*
|
/*
|
||||||
* Load operations.
|
* Load operations.
|
||||||
*/
|
*/
|
||||||
load = function() {
|
load() {
|
||||||
return this.scheduleService.query(this.accountId)
|
return this.scheduleService.query(this.accountId)
|
||||||
.subscribe((schedules: Schedule[]) => {
|
.subscribe((schedules: Schedule[]) => {
|
||||||
this.operations = schedules;
|
this.operations = schedules;
|
||||||
@ -52,7 +52,7 @@ export class ScheduleComponent {
|
|||||||
/*
|
/*
|
||||||
* Save operation.
|
* Save operation.
|
||||||
*/
|
*/
|
||||||
save = function(operation: Schedule) {
|
save(operation: Schedule) {
|
||||||
let subscription: Observable<Schedule>;
|
let subscription: Observable<Schedule>;
|
||||||
|
|
||||||
if(operation.id) {
|
if(operation.id) {
|
||||||
@ -79,7 +79,7 @@ export class ScheduleComponent {
|
|||||||
/*
|
/*
|
||||||
* Delete an operation and return a promise.
|
* Delete an operation and return a promise.
|
||||||
*/
|
*/
|
||||||
confirmDelete = function(operation: Schedule) {
|
confirmDelete(operation: Schedule) {
|
||||||
var title = "Delete operation #" + operation.id;
|
var title = "Delete operation #" + operation.id;
|
||||||
|
|
||||||
this.$modal({
|
this.$modal({
|
||||||
@ -105,7 +105,7 @@ export class ScheduleComponent {
|
|||||||
/*
|
/*
|
||||||
* Delete operation.
|
* Delete operation.
|
||||||
*/
|
*/
|
||||||
delete = function(operation: Schedule) {
|
delete(operation: Schedule) {
|
||||||
var id = operation.id;
|
var id = operation.id;
|
||||||
|
|
||||||
return this.scheduleService.delete(operation).subscribe(() => {
|
return this.scheduleService.delete(operation).subscribe(() => {
|
||||||
@ -126,7 +126,7 @@ export class ScheduleComponent {
|
|||||||
* Open the popup to modify the operation, save it on confirm.
|
* Open the popup to modify the operation, save it on confirm.
|
||||||
* @returns a promise.
|
* @returns a promise.
|
||||||
*/
|
*/
|
||||||
modify = function(operation: Schedule) {
|
modify(operation: Schedule) {
|
||||||
// FIXME Alexis Lahouze 2017-06-15 i18n
|
// FIXME Alexis Lahouze 2017-06-15 i18n
|
||||||
var title = "Operation";
|
var title = "Operation";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user