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(); });});

Installing Ruby on Rails, RubyMine and MongoDB on Ubuntu Linux

Here are some really basic instructions which should work on a virgin installation of Ubuntu Linux.  I tried following some instructions in a book but they were awful, these are what I ended up with. Install some installation helper tools etc sudo apt-get install build-essential git-core sudo apt-get install curl bash -s stable < <(curl …
Continue reading Installing Ruby on Rails, RubyMine and MongoDB on Ubuntu Linux