Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created November 13, 2015 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/d29265454f2201919c01 to your computer and use it in GitHub Desktop.
Save justinyoo/d29265454f2201919c01 to your computer and use it in GitHub Desktop.
Event Sourcing & CQRS Pattern for SPA
module app.angular.Directives {
export interface IUserReplayedScope extends ng.IScope {
model: angular.Models.ReplayViewModel;
}
export class UserReplayed implements ng.IDirective {
replace = true;
restrict = "EA";
scope = {};
templateUrl = "/App/components/userReplayed/userReplayed.html";
controller($scope: IUserReplayedScope, replayViewFactory: angular.Factories.ReplayViewFactory) {
$scope.model = replayViewFactory.getReplayedView();
}
}
}
angular.module("app")
.directive("userReplayed", () => new app.angular.Directives.UserReplayed());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment