Answer the question
In order to leave comments, you need to log in
How to make PhpStorm highlight service methods in angular?
Good afternoon!
Code example:
//demo.controller.js
"use strict";
/**
* @ngInject
*/
class DemoController {
constructor($element, ClientService) {
$element.on('click', () => {
ClientService.getClientsList().then((clients)=> {
console.log(clients);
})
});
}
}
export default DemoController;
//client.service.js
"use strict";
class ClientService {
/**
* @ngInject
* @param $http
*/
constructor($http) {
this.$http = $http;
}
getClientsList() {
return this.$http.get('/clients').then((response) => response.data.clients )
}
}
export default ClientService;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question