public static void CtlFunction( [Name("$scope")] ControllerDataObjectStructure scope) { scope.Message = "Hello, Angular defined as nice $scope function."; scope.Foo = "Foo fighter nice $scope"; scope.Bar = "Nice $scope 777 slot"; scope.Checkpoints = new List <object> { new { callsign = "Alpha", id = 85 }, new { callsign = "Baker", id = 35 }, new { callsign = "Charlie", id = 55 }, new { callsign = "Delta", id = 6 } }.ToArray(); }
/// <summary> /// AngularJS requires to be defined on document parse. /// TODO: create an onParse attribute /// </summary> public static void StartUp() { Console.Log("Checkpoint Charlie: I must be printed BEFORE " + "Checkpoint 1."); AngularJSDemo.hwbApp = Angular.Module("hwbApp"); var controllerData = new { message = "Hello, AngularJS message " + "defined in Bridge's C#! :D" }; AngularJSDemo.hwbApp.Controller("hwbctl", controllerData); AngularJSDemo.hwbApp.Directive("brdEntryPoint", AngularJSDemo.dynMehTemplate); var checkpoints = new List <object> { new { callsign = "Alpha", id = 98 }, new { callsign = "Baker", id = 78 }, new { callsign = "Charlie", id = 58 }, new { callsign = "Delta", id = 9 } }; var controllerStrongData = new ControllerDataObjectStructure() { Message = "Hello, AngularJS message defined in Bridge's C#'s " + "strongly typed class! :D", Foo = "Foo fighters from strong C#.", Bar = "Strong C# 777 slot", Checkpoints = checkpoints.ToArray() }; AngularJSDemo.hwbApp.Controller("hwbSctl", controllerStrongData); AngularJSDemo.hwbApp.Directive("brdEntryPointForThree", AngularJSDemo.ThreeWayFunction); Document.DocumentElement.SetNGApp(AngularJSDemo.hwbApp); }
/// <summary> /// AngularJS requires to be defined on document parse. /// TODO: create an onParse attribute /// </summary> public static void StartUp() { Console.Log("Checkpoint Charlie: I must be printed BEFORE " + "Checkpoint 1."); AngularJSDemo.hwbApp = Angular.Module("hwbApp"); var controllerData = new { message = "Hello, AngularJS message " + "defined in Bridge's C#! :D" }; AngularJSDemo.hwbApp.Controller("hwbctl", controllerData); AngularJSDemo.hwbApp.Directive("brdEntryPoint", AngularJSDemo.dynMehTemplate); var checkpoints = new List<object> { new { callsign = "Alpha", id = 98 }, new { callsign = "Baker", id = 78 }, new { callsign = "Charlie", id = 58 }, new { callsign = "Delta", id = 9 } }; var controllerStrongData = new ControllerDataObjectStructure() { Message = "Hello, AngularJS message defined in Bridge's C#'s " + "strongly typed class! :D", Foo = "Foo fighters from strong C#.", Bar = "Strong C# 777 slot", Checkpoints = checkpoints.ToArray() }; AngularJSDemo.hwbApp.Controller("hwbSctl", controllerStrongData); AngularJSDemo.hwbApp.Directive("brdEntryPointForThree", AngularJSDemo.ThreeWayFunction); Document.DocumentElement.SetNGApp(AngularJSDemo.hwbApp); }