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
var i = 0; | |
var myVar = setInterval(myTimer, 3000); | |
function myTimer() { | |
var els = document.getElementById("grid-container").getElementsByClassName("ytd-expanded-shelf-contents-renderer"); | |
if (i < els.length) { |
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 xml2js = require('xml2js'); | |
const xml = '<root>Hello world!</root>' | |
xml2js.parseString(xml, function (err, result) { | |
console.log(result.root); // Output: Hello world! | |
}); |
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 xml2js = require('xml2js'); | |
const xml = '<root>Hello world!</root>' | |
xml2js.parseString(xml, function (err, result) { | |
console.log(result.root); // Output: Hello world! | |
const json = JSON.stringify(result); | |
console.log(json); // Output: {"root":"Hello world!"} |
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 xml2js = require('xml2js'); | |
const productXML = '<Product><ID>10</ID><Name>Pizza</Name></Product>'; | |
xml2js.parseString(productXML, function (err, result) { | |
// console.dir will allow us to print the whole object in our console | |
console.dir(result); // Output: { Product: { ID: [ '10' ], Name: [ 'Pizza' ] } } | |
console.dir(result.Product); // Output: { ID: [ '10' ], Name: [ 'Pizza' ] } | |
console.log(result.Product.ID[0]); // Output: 10 | |
console.log(result.Product.Name[0]); // Output: Pizza |
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 xml2js = require('xml2js'); | |
const productXML = '<Product><ID>10</ID><Name>Pizza</Name></Product>'; | |
xml2js.parseString(productXML, { explicitArray : false }, function (err, result) { | |
// console.dir will allow us to print the whole object in our console | |
console.dir(result); // Output: { Product: { ID: '10', Name: 'Pizza' } } | |
console.dir(result.Product); // Output: { ID: '10', Name: 'Pizza' } | |
console.log(result.Product.ID); // Output: 10 | |
console.log(result.Product.Name); // Output: Pizza |
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 xml2js = require('xml2js'); | |
const productXML = '<Product><ID>10</ID><Name>Pizza</Name></Product>'; | |
xml2js.parseString(productXML, { explicitArray : false }, function (err, result) { | |
// console.dir will allow us to print the whole object in our console | |
console.dir(result); // Output: { Product: { ID: '10', Name: 'Pizza' } } | |
console.dir(result.Product); // Output: { ID: '10', Name: 'Pizza' } | |
console.log(result.Product.ID); // Output: 10 | |
console.log(result.Product.Name); // Output: Pizza |
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
<h1>{{ 500 | currency : 'GBP' }}</h1> // Output: £500 | |
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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'myCustomPipe' | |
}) | |
export class MyCustomPipe implements PipeTransform { | |
transform(value: any, args?: any): any { | |
return null; | |
} | |
} |
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
<h1>{{ 'Hello world' | myCustomPipe }}</h1> // Output is empty | |
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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'myCustomPipe' | |
}) | |
export class MyCustomPipe implements PipeTransform { | |
transform(value: any, args?: any): any { | |
return value; | |
} | |
} |
NewerOlder