blob: ca017c473f944cedf6e305e57521eaa578cb6dbb [file] [log] [blame]
Max Chu3c8b65f2017-07-19 17:47:59 -07001let self;
2
3class ElineSide {
4
5 static $inject = ['XosSidePanel', 'XosModelStore', '$http', '$log', 'toastr'];
6
7 constructor(
8 private XosSidePanel: any,
9 private XosModelStore: any,
10 private $http: any,
11 private $log: any,
12 private toastr: any,
13 ) {
14 self = this;
15 }
16
17 public saveEline(item: any) {
18 let path = item.path;
19 delete item.path;
20 item.$save().then((res) => {
21 item.path = path;
22 this.toastr.success(`${item.name} successfully saved!`);
23 })
24 .catch((error) => {
25 this.toastr.error(`Error while saving ${item.name}: ${error.specific_error}`);
26 });
27 }
28
29
30}
31
32export const elineSide: angular.IComponentOptions = {
33 template: require('./eline-side.component.html'),
34 controllerAs: 'vm',
35 controller: ElineSide,
36 bindings: {
37 mng: '='
38 }
39};