@@ -3,14 +3,13 @@ import { ActivatedRoute,Router } from '@angular/router';
33
44import { MetadataService } from '../../../services/metadata.service' ;
55import { MessageService } from '../../../message/message.service' ;
6- import { DeviceProfileResponse } from '../../../contracts/v2/responses/device-profile-response' ;
76
87@Component ( {
98 selector : 'app-edit-profile' ,
109 templateUrl : './edit-profile.component.html' ,
1110 styleUrls : [ './edit-profile.component.css' ]
1211} )
13- export class EditProfileComponent implements OnInit , OnDestroy {
12+ export class EditProfileComponent implements OnInit , OnDestroy {
1413
1514 profileYamlSource ?: any ;
1615 codeMirrorEditor : any ;
@@ -29,16 +28,14 @@ export class EditProfileComponent implements OnInit,OnDestroy {
2928 this . metaSvc . findProfileYamlByNameViaUIBackend ( params [ 'profileName' ] ) . subscribe ( ( data : any ) => {
3029 // this.profileYamlSource = data;
3130 this . codeMirrorEditor . setValue ( data ) ;
31+ this . codeMirrorEditor . refresh ( ) ;
3232 } ) ;
3333 }
3434 } ) ;
3535 }
3636
3737 update ( ) {
38- // this.profileYamlSource = this.codeMirrorEditor.getValue();
39- let d = $ ( "#editor" ) . val ( )
40- // console.log(d)
41- // return
38+ this . codeMirrorEditor . refresh ( ) ;
4239 this . metaSvc . updateProfileYamlContentViaUIBackend ( this . codeMirrorEditor . getValue ( ) ) . subscribe ( data => {
4340 this . msgSvc . success ( 'Update profile' , `name: ${ this . profileName } ` ) ;
4441 this . router . navigate ( [ '../device-profile-list' ] , { relativeTo : this . route } ) ;
0 commit comments