Can't use abp services in typescript
See original GitHub issueHi
I’ve seen that #813 has been merged in, and shouldn’t it already be available?
Because, I can’t seem to figure out, why I can’t get my services to work in my typescript file, as I already commented about in the pull-request:
It’s working fine in JS files, no problems there.
@iyhammad @RonFrick Is it possible that either of you, could provide a gist with the implementation of apb services in typescript?
I cant seem to get it working, by following either of your examples.
export class DietplanController {
//private todos: TodoItem[];
// $inject annotation.
// It provides $injector with information about dependencies to be injected into constructor
// it is better to have it close to the constructor, because the parameters must match in count and type.
// See http://docs.angularjs.org/guide/di
public static $inject = [
'$scope',
'$http',
'alertService',
'abp.services.app.dietplan'
];
// dependencies are injected via AngularJS $injector
// controller's name is registered in Application.ts and specified from ng-controller attribute in index.html
constructor(
private $scope: IDietplanScope,
private $http: ng.IHttpService,
private $alertService: AlertService,
private dietplanService: abp.services.app.dietplan
) {
in the constructor, it cant find “abp”.
Kind regards
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
Unable to call service from javascript via Dynamic Client Proxy ...
It appears as if my ABP Service is not being included in the ServiceProxyScript that gets loaded. Steps to reproduce issue. Run the...
Read more >Angular Boilerplate not reading abp - javascript
I'd just delete this question. Screenshots of code are not useful, as visually impaired users and search engine crawlers can't use them (and...
Read more >typescript errors in UI project #2582
typescript errors in UI project #2582 ... -module\src\auth\permission-checker.service.ts(7,16): error TS2304: Build:Cannot find name 'abp'.
Read more >Build a Simple To Do App with ABP Framework [Single Layer ...
This is a quick start tutorial to build a simple To Do application with the ABP Framework. We'll use the Single Layer Template...
Read more >ASP.NET Boilerplate authorization
In an application service (application layer), we use the Abp.Authorization.AbpAuthorize attribute. · In an MVC controller (web layer), we use the Abp.Web.Mvc.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Worthy7 I am going to try hooking nswag up, using the command line to see what output I can get. I will let you know what I find.
Halil, The problem we are having as a team writing typescript, is when other people make changes to the app services and update the definition file it causes our build server to fail. It’s a catch 22 when the typescript generation depends on the web project successfully building, but the web fails because the typescript definition has changed.
If we could update our typescript definitions for the app service without an endpoint, then it would solve our issue, and I believe it will solve what worth7 is needing.
As a side note I absolutely love having our app service generated along with all of our dtos. It saves so much time and getting new devs up to speed has been a great feature. I would not want to go back to doing everything by hand. We just have this one problem when working as a group.
Thanks again for everything you have put together.
I agree, t4 would be an awesome approach for those of us using TS and Angular.