Skip to content

Instantly share code, notes, and snippets.

View SwarnaKishore's full-sized avatar

Swarna Avvaru SwarnaKishore

View GitHub Profile
@SwarnaKishore
SwarnaKishore / app.component.ts
Created August 14, 2017 21:07
using-jquery-in-angular
import { Component, OnInit } from '@angular/core';
import * as $ from 'jquery';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'Look jQuery Animation working in action!';
@SwarnaKishore
SwarnaKishore / app.component.ts
Created August 10, 2017 14:40
angular safe pipe demonstration
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<div [innerHtml]="htmlSnippet | safe: 'html'"></div>
`,
})
export class App {
@SwarnaKishore
SwarnaKishore / safe.pipe.ts
Created August 10, 2017 13:58
angular safe pipe gist
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl } from '@angular/platform-browser';
@Pipe({
name: 'safe'
})
export class SafePipe implements PipeTransform {
constructor(protected sanitizer: DomSanitizer) {}
@SwarnaKishore
SwarnaKishore / app.component.ts
Last active August 10, 2017 13:52
Safe pipe
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<div [innerHtml]="htmlSnippet"></div>
`,
})
export class App {
<!DOCTYPE HTML>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<link rel="stylesheet" href="rain.css">
<style id="jsbin-css">