OLD | NEW |
1 #!mojo:js_content_handler | 1 #!mojo mojo:js_content_handler |
2 // Demonstrate sharing services via application ServiceProviders. | 2 // Demonstrate sharing services via application ServiceProviders. |
3 // This application is launched by share_echo.js. It both provides | 3 // This application is launched by share_echo.js. It both provides |
4 // and requests an EchoService implementation. | 4 // and requests an EchoService implementation. |
5 // | 5 // |
6 define("main", [ | 6 define("main", [ |
7 "console", | 7 "console", |
8 "mojo/services/public/js/application", | 8 "mojo/services/public/js/application", |
9 "examples/echo/echo_service.mojom", | 9 "examples/echo/echo_service.mojom", |
10 ], function(console, application, echo) { | 10 ], function(console, application, echo) { |
11 | 11 |
(...skipping 15 matching lines...) Expand all Loading... |
27 var echoService = shareEchoSP.requestService(EchoService); | 27 var echoService = shareEchoSP.requestService(EchoService); |
28 echoService.echoString("ShareEchoTarget").then(function(response) { | 28 echoService.echoString("ShareEchoTarget").then(function(response) { |
29 console.log(response.value); | 29 console.log(response.value); |
30 }); | 30 }); |
31 shareEchoSP.provideService(EchoService, EchoServiceImpl); | 31 shareEchoSP.provideService(EchoService, EchoServiceImpl); |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
35 return ShareEchoTarget; | 35 return ShareEchoTarget; |
36 }); | 36 }); |
OLD | NEW |