Thursday, 29 April 2021
Wednesday, 28 April 2021
Monday, 26 April 2021
angular active gaurd example
ng g guard <name>
give u 4 different options from that select one
Saturday, 24 April 2021
Friday, 23 April 2021
angular filter tutorial
This is sample code how to filter list in an angular
below the working sample
angular hide header if user not login
import { Router } from "@angular/router";
constructor(public router: Router){}
<nav *ngIf="router.url !== '/login' && router.url !== '/signup'"> // or maybe only 'login'
</nav>
convert basic authentication
String username = "abc";
String password = "123";
String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1")
.GetBytes(username + ":" + password));
httpWebRequest.Headers.Add("Authorization", "Basic " + encoded);
Thursday, 22 April 2021
web apis
[Route("~/api/Secrets/{name:string}")]
public string GetSecrets(string uri, string name)
{
var keyVaultName= name;
var kvUris = $"https://{keyVaultName}.vault.azure.net";
}
if you like to pass the string or id from api then donot use name:string youll get parameter error
use only {name}
Wednesday, 21 April 2021
asp.net core and angular crud
here sample example of crud using angular and aps.net
and here made to cross issue and headers issues using above by creating cs file
Sunday, 18 April 2021
Friday, 16 April 2021
Angular bootstrap tabs
<ul class="nav nav-tabs">
<li class="active"><a data-target=".tab-pane" data-toggle="tab">All</a></li>
<li><a data-target="#tab1" data-toggle="tab">Tab 1</a></li>
<li><a data-target="#tab2" data-toggle="tab">Tab 2</a></li>
</ul>
<div class="tab-content">
<div id="tab1" class="tab-pane active">Yeahhh, this is Tab 1.</div>
<div id="tab2" class="tab-pane active">Yup, yup, this is Tab 2.</div>
</div>
Thursday, 15 April 2021
angular tutorial
The two-way banana-in-the-box model binding is a special case, but Angular has a few standard ways to bind common things:
- [disabled]="disabledState": Any attribute can be bound with square brackets.
- (click)="buttonClick(album)": Events are bound with parenthesis.
- #form1="ngForm": Element name bindings
- *ngXX: Directives like *ngIf and *ngFor
- {{album.title}}: Inline expression bindings
Wednesday, 14 April 2021
Angular data bind
signIn(provider) {
this._auth.login(provider).subscribe(
(data) => {
console.log(data);
this.hideForm = false;
this.emaill = data.email;
this.nom = data.last_name;
this.prenom = data.first_name;
this.profileImage = data.image;
})
}
error TS2339: Property 'email' does not exist on type 'Object'.
solution: Replace(data)
with(data : any)
Angular model popup bootstrap
simple way to work model popup
Just remove style and aira-hideen attributes then it will work fine in angular
Protect apis using azure certificate
This is tutorial of how to protect our apis from certificate generated in azure keyvault. accessing the certificate using thumbprint
1.read api with azure certificate and basic authentication
[Route("~/api/test")]
public string GetcustomField ()
{
string thumbprint = "CA3655E816A1CBF11F7CFC6A97E28A371366B190";
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certificates = store.Certificates.Find(X509FindType.FindByThumbprint, thumbprint, false);
X509Certificate2 certificate = certificates[0];
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://api.entrust.net/enterprise/v2/organizationalUnits");
req.Method = WebRequestMethods.Http.Get;
req.Headers.Add("Authorization", "Basic OTU3Y2NkMThiMi00NjU0OTYyMjomSDdEVStXRDkhQiFPUFNCUkI3SQ==");
req.ClientCertificates.Add(certificate);
var httpResponse = (HttpWebResponse)req.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
return streamReader.ReadToEnd();
}
}
Wednesday, 7 April 2021
Div hide based on dropdown value
<div class=" col-sm-6">
Friday, 2 April 2021
Angular Navigation
<ul class="nav navbar-nav">
<li [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}">
<a [routerLink]="['/']">Home</a>
</li>
<li [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}">
<a [routerLink]="['/about']">About</a>
</li>
<li [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}">
<a [routerLink]="['/calendar']">Calendar</a>
</li>
</ul>
for / active link not working so use exact:true;
7 Common mistakes in Dot Net — You can avoid
There are many common mistakes made during .NET (ASP.NET, .NET Core) development, which affect performance, security, and code… Code Crack...

-
Points 1.complex page layouts and adherence to code standards. 2.primeNG pagination 3.ngcontent 4.ngdestory(memorylekage) 5.datatransfer wi...
-
Check duplicate count based on 3 columns combo select EMPID,FORMinfoID,FormName,Count(*) as counts from tbl_FilesMigrationLogs group by Em...