This file contains hidden or 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.Text.RegularExpressions; | |
public static class Highlighter | |
{ | |
private const string MatchPattern = "(?<!<[^>]*)(?<matched>{0})"; | |
private const string ReplacePattern = "<span class='highlight'>${matched}</span>"; | |
public static string Highlight(string value, string pattern) | |
{ | |
var patternEsc = string.Format(MatchPattern, Regex.Escape(pattern)); |
This file contains hidden or 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
class DataLoggingWatcher | |
constructor: (@$rootScope) -> | |
@$rootScope.$on 'newData', () => @logToConsole() | |
logToConsole: () => | |
console.log 'new data arrived' | |
angular.module('myApp') |
NewerOlder