This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-16
lines changed Expand file tree Collapse file tree 2 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -365,19 +365,17 @@ export class HelloWorldModel extends Observable {
365365 }
366366
367367 public doWebDeleteFile ( ) : void {
368- const storageRef = firebaseWebApi . storage ( ) . ref ( ) ;
369- const childRef = storageRef . child ( "uploads/images/telerik-logo-uploaded.png" ) ;
370-
371- childRef . delete ( ) . then (
372- ( ) => {
368+ firebaseWebApi . storage ( ) . ref ( )
369+ . child ( "uploads/images/telerik-logo-uploaded.png" )
370+ . delete ( )
371+ . then ( ( ) => {
373372 console . log ( "Deleted file" ) ;
374373 this . set ( "storageFeedback" , "File deleted" ) ;
375- } ,
376- error => {
374+ } )
375+ . catch ( error => {
377376 console . log ( "Error deleting file: " + error ) ;
378377 this . set ( "storageFeedback" , "Error deleting file: " + error ) ;
379- }
380- ) ;
378+ } ) ;
381379 }
382380
383381
Original file line number Diff line number Diff line change @@ -239,12 +239,10 @@ You can pass in remote file path to delete it.
239239#### TypeScript
240240
241241``` typescript
242- const storageRef = firebaseWebApi .storage ().ref ();
243- const childRef = storageRef .child (" uploads/images/telerik-logo-uploaded.png" );
244-
245- childRef .delete ().then (
246- () => console .log (" Deleted file" ),
247- error => console .log (" Error deleting file: " + error )
248- );
242+ firebaseWebApi .storage ().ref ()
243+ .child (" uploads/images/telerik-logo-uploaded.png" )
244+ .delete ()
245+ .then (() => console .log (" Deleted file" ))
246+ .catch (error => console .log (" Error deleting file: " + error ));
249247```
250248</details >
You can’t perform that action at this time.
0 commit comments