1 / 9

Building an AngularJS Application with Haxe: OOP and Dependency Injection

This guide provides a comprehensive overview of developing applications using Haxe with AngularJS, focusing on object-oriented programming (OOP) principles and dependency injection methods. It explains how to structure your AngularJS modules, manage dependencies automatically, and group components into various classes by type. Discover the 11 component types available and their respective functions in your application. Each class should implement necessary interfaces and include static main functions to ensure smooth integration. Enhance your app's performance and maintainability with best practices in Haxe and AngularJS.

Télécharger la présentation

Building an AngularJS Application with Haxe: OOP and Dependency Injection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Understand haxejs-angular app How to write app in OOP(Haxe) and Dependency Injection Way(Angular)?

  2. Package to be angularjs module name 1) They all belong to “test” module 2) Module dependencies will be managed automatically www.haxejs.com

  3. Group components into different classes(files) by type Total 11 types of components: • Controller • Directive • Service • Config • Run • Constant • Value • Filter • Provider • Animation • Factory www.haxejs.com

  4. Each type class(file) should 1) Implement an interface, like IControllers 2) Has a public static main function 3) Remember to import ng.Angular even your code does not use any of it www.haxejs.com

  5. Every component should use • @:inject meta to inject dependencies (it can be empty) • Static Dynamic variable name to be the name of your component • $scope component is of NgScope type ($->Ng) www.haxejs.com

  6. Component can be a class Like service, controller, provider www.haxejs.com

  7. Component can be a function Like config, run, directive www.haxejs.com

  8. Controller component should extend BaseCtrl class • Call super() in new function • Camel class name to be the object name inside html code www.haxejs.com

  9. Provider component should extend BaseProvider with get function • Invoke service by “xx” name to access what get function returns • Config service by “xxProvider” name to call setting functions like “change” www.haxejs.com

More Related