Saturday, November 28, 2020

How to assign property value while initializing class in typescript

 While creating new object you want to set the value of few fields of class , then you can use following feature of typescript to do that : 


class Person {
    public name: string = "default"
    public address: string = "default"
    public age: number = 0;

    public constructor(init?:Partial<Person>) {
        Object.assign(this, init);
    }
}

let persons = [
    new Person(),
    new Person({}),
    new Person({name:"John"}),
    new Person({address:"Earth"}),    
    new Person({age:20, address:"Earth", name:"John"}),
];


Saturday, November 21, 2020

How to make sure application always run with admin access

 Most of the time it happen with programmer , that they forget to run the application (Visual Studio/VS Code or any other IDE) with admin access. Because of that in result they face weird errors. So instead of every time facing same issue again and again, we can set the application permission in such way that its always run with admin access. 


Here are the steps which you can use to make sure your application always run with admin access. 


how to make sure application always run with admin access


        1. Open Start.
        2. Search for the app that you want to run elevated.
        3. Right-click the top result, and select Open file location. ...
        4. Right-click the app shortcut and select Properties.
        5. Click on the Shortcut tab.
        6. Click the Advanced button.
        7. Check the Run as administrator option.

Tuesday, November 17, 2020

How to find the angular component name ?

 

Use ng.probe($0).componentInstance

You can select a component using the Element Selector from the Elements Tab. And then go to the Console Tab, and type in:

ng.probe($0).componentInstance

ASP.NET Core

 Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...