CHunky Universe of Vigourous Astonishing SHarepoint :)

Tag Archives: jslib

AngularJS: sync $ with an input value

I have used AngularJS for a while and to me this seems to be the best MVC javascript framework.

Today I wanted to implement a search which uses an input and a hash query string like in google. The input value and url have to be synced like:


To do this we have to inject $location into our angular control. See the Angular Guide about $location. Then we have to observe both the $scope.term (which is bound to the input value) and $

<!doctype html>
<html ng-app>
    <script src="">
    <script src="project.js"></script>
    <h2>Hash Search</h2>
    <div ng-controller="SearchCtrl">
        <input type="text" ng-model="term"/>

and javascript (project.js):

function SearchCtrl($scope, $location) {

	var termKey = "term";

	$scope.$watch(function () { return $; }, function() {
	  $scope.term = $[termKey] || "";
	$scope.$watch('term', function(term) {
	   $, term);

In order to be able to listen to changes on $, you have to provide an anonymous function in $watch. Thanks to Renan Tomal Fernandes’ answer on stackoverflow.

Determine if Silverlight is installed (javascript)

For a while ago I needed to provide an alternative solution when Silverlight isn’t installed. I searched  for javascript code for this and found this:

I didn’t need to determine the version of Silverlight, so I wrote a simplified js function (but it works in all browsers):

var isSilverlightInstalled = function() {    
    var installed = false;
    try {
	installed = !!navigator.plugins["Silverlight Plug-In"]
	     || !!(window.ActiveXObject &amp;&amp; new ActiveXObject('AgControl.AgControl'));
    catch (e) {}
    return installed;

This function first checks if a Silverlight plugin is installed in almost all web browsers except IE, then if it is not it tries to create an ActiveXObject (IE) for Silverlight. If an error occurs, the function returns false and indicates that Silverlight is not available.

Masked Inputs

Just a quick tip today. If you are looking after masked inputs like the old ASP.NET Ajax Control Toolkit MaskedEdit, you can try jQuery plugin called Masked Input from DigitalBush or even better jquery.inputmask.

Daniel Chronlund Cloud Tech Blog

News, tips and thoughts for Microsoft cloud fans

Вула Чăвашла

VulaCV - Чăвашла вулаттаракан сайт

Discovering SharePoint

And going crazy doing it

Bram de Jager - Architect, Speaker, Author

Microsoft 365, SharePoint and Azure

SharePoint Dragons

Nikander & Margriet on SharePoint

Mai Omar Desouki

PFE @ Microsoft

Cameron Dwyer

Office 365, SharePoint, Azure, OnePlace Solutions & Life's Other Little Wonders


Me and My doings!

Share SharePoint Points !

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

Aryan Nava

DevOps, Cloud and Blockchain Consultant


SharePoint for everyone


Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint


Mostly what I know and share about...