Base solution for your next web application

Activities of "thor"

Thank you very much!

Yes, I have updated Angular recently. And yes the initial/standard pages are all working.

I will send through the specific feature branch I have been playing around with to the email address below. Do you want all of it?

Morning,

I have a bit of an issue which I cannot seem to resolve by myself. I am using the Core+Angular template.

Firstly, I have created a number of AppServices in a separate module (i.e. not in the standard MyProject*.Application project). These are all working fine when using the Swagger UI and Postman.

Then I ran nswag/refresh.bat and referred to the generated ProxyServices as providers in service-proxymodule.ts

I have then created a couple of Components.

  1. They are declared in main.module.ts
  2. The ProxyServices are included as providers in main.module.ts
  3. Added a path for my components in main-routing.module.ts
  4. Included a link to my page in navigation

When I open the page in a browser I get 401 (Unauthorized). This is because the server is complaining the user hasn't been logged in.

Using Fiddler I notice that my component does not include any auth header tokens.

Below is some sample code from my component:

import { Component, Injector, ViewEncapsulation, OnInit } from '@angular/core';
import { appModuleAnimation } from '@shared/animations/routerTransition';
import { AppComponentBase } from '@shared/common/app-component-base';
import { PatientsServiceProxy, CreateOrEditPatientDto, GetPatientForEditOutput} from '@shared/service-proxies/service-proxies';
declare let d3, Datamap: any;

@Component({
    templateUrl: './patient-details.component.html',
    encapsulation: ViewEncapsulation.None,
    animations: [appModuleAnimation()]
})

export class PatientDetailsComponent extends AppComponentBase implements OnInit {

    ngOnInit(): void {

    }

    constructor(
        injector: Injector,
        private _patientsServiceProxy: PatientsServiceProxy

    ) {
        super(injector);
    }

    active: boolean = false;
    saving: boolean = false;

    patientId: string;

    patient: CreateOrEditPatientDto = new CreateOrEditPatientDto();

    savePatient(): void {
        this.saving = true;
        this._patientsServiceProxy.createOrEdit(this.patient)
            .finally(() => { this.saving = false; })
            .subscribe(() => {
                this.notify.info(this.l('SavedSuccessfully'));
            });
    }
}

How do I get my component to include the auth? I thought that proxy services would solve that...

Thank you for getting back to me. As always, I am very grateful for the help you all provide and I think you are doing a great job with the platform.

I forgot to run yarn after I had added the reference into package.json. Once this was done the problem went away!

Hi,

Thank you for sharing. I am trying to do a similar thing. However, I am facing a few problems. When you were implementing this, did you encounter the following problem with the draggable.js script in ngAfterViewInit (and if so, did you find a solution):

ERROR in src/app/main/demographics/patient-details/patient-details.component.ts(95,25): error TS2345: Argument of type '{ connectWith: string; items: string; opacity: number; handle: string; coneHelperSize: boolean; p...' is not assignable to parameter of type 'SortableOptions'. Object literal may only specify known properties, but 'coneHelperSize' does not exist in type 'SortableOptions'. Did you mean to write 'forceHelperSize'? src/app/main/demographics/patient-details/patient-details.component.ts(100,25): error TS1117: An object literal cannot have multiple properties with the same name in strict mode. src/app/main/demographics/patient-details/patient-details.component.ts(100,25): error TS2300: Duplicate identifier 'tolerance'. src/app/main/demographics/patient-details/patient-details.component.ts(101,25): error TS1117: An object literal cannot have multiple properties with the same name in strict mode. src/app/main/demographics/patient-details/patient-details.component.ts(101,25): error TS2300: Duplicate identifier 'forcePlaceholderSize'. src/app/main/demographics/patient-details/patient-details.component.ts(102,25): error TS1117: An object literal cannot have multiple properties with the same name in strict mode. src/app/main/demographics/patient-details/patient-details.component.ts(102,25): error TS2300: Duplicate identifier 'helper'.

C:\Repos\Danely\angular>ng -v

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.0.0
Node: 8.9.3
OS: win32 x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.1
@angular-devkit/build-optimizer   0.6.1
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@ngtools/webpack                  6.0.1
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Thank you for getting back. I looked at that as well. Below is the full tsconfig.json file

{ "compilerOptions": { "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es6", "dom" ], "mapRoot": "./", "module": "es6", "skipLibCheck": true, "moduleResolution": "node", "outDir": "../dist/out-tsc", "sourceMap": true, "target": "es5", "typeRoots": [ "../node_modules/@types" ], "baseUrl": ".", "paths": { "@abp/": [ "../node_modules/abp-ng2-module/dist/src/" ], "@app/": [ "./app/" ], "@shared/": [ "./shared/" ], "@node_modules/": [ "../node_modules/" ], "@angular/": [ "../node_modules/@angular/" ] } }, "exclude": [ "node_modules" ] }

I can now compile and run the application. The only "problem" is that it takes a loooong time to complete the sourcemap process. There is a lot of people talking about getting stuck on 92% when reading various forums (see for instance <a class="postlink" href="https://stackoverflow.com/questions/49184787/92-chunk-asset-optimization-webpack">https://stackoverflow.com/questions/491 ... on-webpack</a> ) . Before upgrading to 5.4.1 I don't recall this taking minutes, but it is now. If I am the only one with this problem then it could be a merge problem or something else I have done...

That was the first I tried (After deleting yarn.lock and running yarn again). I then tried lots of different things but I think it was running ng build that finally fixed it. Still hangs on 92% when running npm start...

I have updated to 5.4.1 a couple of days ago. When I try to run code generated by the RAD Tool I get the following error:

ERROR in ./node_modules/abp-ng2-module/src/notify/notify.service.ts Module build failed: Error: C:\Repos\Danely\angular\node_modules\abp-ng2-module\src\notify\notify.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (<a class="postlink" href="https://goo.gl/jB3GVv">https://goo.gl/jB3GVv</a>). at AngularCompilerPlugin.getCompiledFile (C:\Repos\Danely\angular\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:709:23) at plugin.done.then (C:\Repos\Danely\angular\node_modules@ngtools\webpack\src\loader.js:41:31) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)

I should also mention that since the upgrade it takes forever to complete sourcemap (it is stuck at 92%) since the upgrade.

Have you seen this before? Do you know why this would be?

OK, thank you for the help!

Showing 1 to 10 of 24 entries