Commit f4589e30 authored by Anusha Mamidala's avatar Anusha Mamidala
Browse files

Added safe pipe and initial components

parent 1bb90184
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
......
This diff is collapsed.
......@@ -7,4 +7,5 @@ import { Component } from '@angular/core';
})
export class AppComponent {
title = 'balaswecha';
appsList = ["../assets/atomic-interactions_en.html", "../assets/balancing-act_en.html"]
}
......@@ -3,10 +3,12 @@ import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SafePipe } from './safe.pipe';
@NgModule({
declarations: [
AppComponent
AppComponent,
SafePipe
],
imports: [
BrowserModule,
......
import { SafePipe } from './safe.pipe';
describe('SafePipe', () => {
it('create an instance', () => {
const pipe = new SafePipe();
expect(pipe).toBeTruthy();
});
});
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from "@angular/platform-browser";
@Pipe({
name: 'safe'
})
export class SafePipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) { }
transform(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
}
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment