Over the past year I’ve been spending my time contracting for a company in Norway. Now that project is completed it is time for me to start playing again, so I thought I’d pick up an old Node Express project. This time I intend to use TypeScript instead of Javascript. I’d also like to write …
Continue reading NodeJS, Web-Express, and TypeScript from scratch
Author:Peter Morris
[Solved] MVCApplication Parser Error
I have this problem because I have to develop with VS running as administrator in order to use Local IIS hosting. When files are added (or generated by compiling) I think VS was setting the owner as Administrator, which IIS then cannot read. Start a command prompt as Administrator and type in the following icacls …
Continue reading [Solved] MVCApplication Parser Error
How to Create a Self Signed Certificate in IIS 7
I know I am going to want this link again in the future!
VSTO Office plugin not appearing in Office 2007
If you have an office VSTO plugin that is working in other versions of Office but not appearing in Office 2007 then try setting the following registry value HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice12.0CommonGeneral Name = EnableLocalMachineVSTOValue (DWORD) = 1
Watching a single property in an array in AngularJS
A typescript example that converts the array’s property into a single string that can be watched. $scope.$watch( () => this.someArray.map(x => x.selected ? “1” : “0”).join(“”), (newValue, oldValue, scope) => this.onSelectionChanged(this.getSelectedItems()));
Getting an AngularJS directive to call back a method on its parent’s controller
Here is a TypeScript example of how to call back a method on the controller from an embedded directive. The most important thing to note is that the directive’s parameter name for your callback uses a & when defined, and when calling that callback you should not use positional parameters but instead use an object …
Continue reading Getting an AngularJS directive to call back a method on its parent’s controller
AngularJs – binding HTML
The directive ng-bind will escape HTML to avoid data acting maliciously. If you want to output html you need to use ng-bind-html <div ng-bind-html=”someHtmlBody”/> The important step to getting this working is to ensure the script angular-sanitize.js is referenced on your page, and it is specified as a dependency when creating a module…. var app …
Continue reading AngularJs – binding HTML
AngularJS routes with ASP MVC Forms authentication
The ASP MVC app I am working on uses forms authentication with a timeout. This means that when the session has timed out and the user clicks refresh they get redirected to a login page, and after that they get directed back to the original page without the deep-linked client-side # part of the url. The …
Continue reading AngularJS routes with ASP MVC Forms authentication
Node.js Express, form validation, and keeping previously posted form values
I’ve been playing with Node.js and the Express webserver framework as a learning experience, it’s good fun 🙂 In the C# ASP MVC world using the Razor view engine I can define my user interface elements like this… @Html.TextBoxFor(x => x.EmailAddress)@Html.ValidationMessageFor(x => x.EmailAddress) This will do three things It will create the html output for …
Continue reading Node.js Express, form validation, and keeping previously posted form values
AngularJS – Triggering code whenever ng-view updates
//Create the modulevar app = angular.module(‘someapp’, [‘ngRoute’]);//Config the routesapp.config(configRoutes);function configRoutes($routeProvider) { $routeProvider .when(‘/’, { templateUrl: ‘/angular/viewtemplates/admin/index.html’, controller: ‘AdminController’ }) .when(‘/categories’, { templateUrl: ‘angular/viewtemplates/admin/categories/index.html’, controller: ‘CategoryIndexController’ })}//Make sure we are notified whenever the ng-view is updatedapp.run(function($rootScope) { $rootScope.$on(‘$viewContentLoaded’, function() { $(‘table[data-toggle=”table”]’).bootstrapTable(); });});
