This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private filterDataSource: BehaviorSubject<Array<any>> = new BehaviorSubject([]); | |
public filterData = this.filterDataSource.asObservable(); | |
updateUserData(data) { | |
this.filterDataSource.next(data); | |
} | |
addData(dataObj) { | |
const currentValue = this.filterDataSource.value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This service acts performs various actions such with Azure AD B2C | |
// It use an external library MSAL.JS minumim version 1.4. Check package.json | |
// Modify environment.ts file to update client id, tenant , policy etc. on changes in Azure portal | |
// First draft by - Dhananjay Kumar in Sprint 0 | |
// Last modified by - Dhananjay Kumar in Sprint 0 | |
// Unit Test - 0 | |
import { Inject, Injectable } from '@angular/core'; | |
declare var Msal: any; | |
import { environment } from 'src/environments/environment'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// // value of 'this' depends on how you are calling the function | |
var Dog = { | |
name :'foo', | |
eat : function(){ | |
console.log(this); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { CourseCatalogService } from '../shared/coursecatalog.service'; | |
import { NavigationExtras, Router, ActivatedRoute } from '@angular/router'; | |
@Component({ | |
selector: 'app-catalog', | |
templateUrl: './catalog.component.html', | |
styleUrls: ['./catalog.component.css'] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Title: Simplifying Dependency Injection in Angular | |
Dependency Injection is one of the most famous architecture patterns to create a scalable application that has loosely coupled entities such as classes. Application made using the DI pattern is highly loosely coupled, and any part such as the business logic layer of application can be replaced at the run time without affecting the presentation layer. By design Angular framework supports dependency injection. It enables you to inject dependencies such as services without writing your own DI container or refereeing to any third-party libraries. | |
You create a service in Angular to share data and operations between components, directives etc. Mainly services are used to achieve separation of concerns and reusability. You keep operations such as API calls, logging, client-side data manipulations, etc. in a service. One of the significant purposes of creating service is to keep component clean that focuses on user interaction and presentations. | |
So, if you create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const domino = require('domino'); | |
//const domino = require('@angular/platform-server/node_modules/domino'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const template = fs.readFileSync('dist/active-directory-javascript-singlepageapp-angular/browser/index.html').toString(); | |
const win = domino.createWindow(template); | |
global['window'] = win; | |
global['document'] = win.document; | |
global['DOMTokenList'] = win.DOMTokenList; | |
global['Node'] = win.Node; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-learningapproach', | |
templateUrl: './learningapproach.component.html', | |
styleUrls: ['./learningapproach.component.scss'] | |
}) | |
export class LearningapproachComponent implements OnInit { | |
constructor() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UnityResolver : IDependencyResolver | |
{ | |
protected IUnityContainer container; | |
public UnityResolver(IUnityContainer container) | |
{ | |
if (container == null) | |
{ | |
throw new ArgumentNullException("container"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using System.Web.Http.Description; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, Input, ChangeDetectionStrategy, OnChanges, ChangeDetectorRef } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { TouchSequence } from 'selenium-webdriver'; | |
@Component({ | |
selector: 'app-child', | |
template: ` | |
<h2>Items : {{_data.counter}} </h2> | |
<button (click)='0'>Refresh</button> | |
`, |