Thursday, 27 January 2022

angular convert tips

 


image.gif



npm run ng serve

if get the error ng not recognised use above

Solution

Recently I found an extension - C# to TypeScript on VSCode that make the process of converting the C# class to TS interface easier (only interface for now).


Tuesday, 25 January 2022

Angular tips

 <!-- If user is loaded show the form, else show the loading template -->

<form
*ngIf="user | async; else loading"
[formGroup]="form"
(ngSubmit)="submit()">

<label for="firstname">First Name</label>
<input id="firstname" formControlName="firstName" />
<div
*ngIf="form.controls.firstName.errors?.required && form.controls.firstName.touched"
class="error" >

*Required
</div>

<label for="lastname">Last Name</label>
<input id="lastname" formControlName="lastName" />
<div
*ngIf="form.controls.lastName.errors?.required && form.controls.lastName.touched"
class="error"
>

*Required
</div>

<label for="about">About</label>
<textarea id="about" formControlName="about"></textarea>

<button [disabled]="!form.valid">Save Profile</button>
</form>

<ng-template #loading>
Loading User...
</ng-template>


localstorage
this.currentUser = JSON.parse(localStorage.getItem('currentUser') || '{}');

Saturday, 22 January 2022

Tips

 [Route("controller")]

[Httpeget("student")]


hotreload

https://www.jetbrains.com/resharper/features/code_refactoring.html#:~:text=This%20refactoring%20helps%20you%20quickly,wrap%20the%20string%20into%20String.


https://mikebridge.github.io/post/csharp-domain-event-aggregator/


https://www.c-sharpcorner.com/article/fix-to-no-access-control-allow-origin-header-is-present-or-w/


getting issues cross webapi in iis publihs

worked this after removed verbs

https://stackoverflow.com/questions/52047548/response-for-preflight-does-not-have-http-ok-status-in-angular/52048304

https://enlabsoftware.com/development/how-to-build-and-deploy-a-three-layer-architecture-application-with-c-sharp-net-in-practice.html



Thursday, 20 January 2022

navbat menu

 >to day leran how to get navbar menu on mouse over in the header part in angular

refer this code. based on css.

dropdownmenu

https://mdbootstrap.com/docs/angular/navigation/navbar/


https://stackblitz.com/edit/angular-ng-template-example-vmoksx?file=app%2Fapp.component.html

side bar


Tuesday, 18 January 2022

Create snippet

 

getcallservice  --mysnippet 

postcall service ---



file location:

C:\Users\Pspl\AppData\Roaming\Code\User\snippets

this is above file for snippet store pls check once

https://snippet-generator.app/




Saturday, 8 January 2022

learn

 https://www.youtube.com/watch?v=vEFlCpSqVL4


https://github.com/techwithpat/Web-API-With-ASP.NET-Core/blob/main/Controllers/BooksController.cs


Friday, 7 January 2022

date formate in sql

 https://www.sqlshack.com/dateadd-sql-function-introduction-and-overview/

checkthis

date add subtract sample check this

Great achive

 today i cracked great think convert google chart js file to angular for charts .

I have sample code of charts in google js formate here

need to convert this to angular formate as like this no need any npm just js in index

so refer both do how to convert js file angular readable


Monday, 3 January 2022

Azure pfx file download

 from azure certificate list download in CER formate

1.after downloading the project create pfx file in local system using mms (run cmd)

  1. Import the certificate chain to their respective stores.
  2. Open the certificate snap-in in the Windows MMC console.
  3. Export the certificate in .pfx from the MMC console.
    i.download cer file from keyvault convert to pfx


    How to Convert a CER Certificate to PFX Without the Private Key?

    1. Import the certificate to its personal certificate store

      Right-click on the certificate file.
      Select install certificate.

    2. Select Local Computer radio button



    3. Select the default automatic store to import the certificate



    4. Import the certificate

    5. Open MMC in Windows server

      Hit Win + R to open the Run utility
      Type mmc in the box.
      Press Ok.

    6. Add Certificate Snap-in

      Go to File > Add/Remove Snap-in..



    7. Select Certificates and press Add



    8. Select the User or Computer Certificate snap-in

      Select the snap-in which you want to create the certificate. For demonstration we are choosing Compute account.
      Click Next.

    9. Select Local Computer

      Select local computer as you are going to create CSR on the same computer.
      Click Finish.
      Load MMC


    10. Select Certificate (Local Computer) and click Ok



    11. Load MMC

      You will see the certificate in the personal store.



follow this link for full details.


AZure CER to PFX

> check this link here

Angular and Asp.net core under one solution

 this are the steps we follow.

1.create solution in .netcore blank page.

2.create porject webapi

3.project one delete all files instead of properties and dependencies.

4.paste angular project folder under first solution

5.change  build path in angular.json(refer sample projects)

6.change few setings in startup.cs

7.change launchurl setting same url


check this link Here



nodejs with mongodb

 npx express-generator --no-view HomeService25 new app deployed to render homeservie25 app from github222 https://dashboard.render.com/web/s...