From cf4933d1b8d492973937d2910a0dd5f0be79b24c Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 5 Feb 2018 11:26:22 -0500 Subject: [PATCH] ang2 notes Signed-off-by: Bill Erickson --- NOTES.adoc | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/NOTES.adoc b/NOTES.adoc index 3bd8c406d..e6b065885 100644 --- a/NOTES.adoc +++ b/NOTES.adoc @@ -18,16 +18,9 @@ Angular 1.x to just drop everything and dash off to Angular2. == Writing a new app the Angular2 way to experiment == -* Install NodeJS v6 -[source,sh] --------------------------------------------------------- -curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - -sudo apt-get install -y nodejs --------------------------------------------------------- - ** See also https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions[NodeJS Install Docs] * https://angular.io/tutorial -** Angular2+ is AngularJS in Greek. Same concepts, new language. -** Modules, Services, Directives+Controllers=Components + ** Angular2+ is AngularJS in Greek. Same concepts, new language. + ** Modules, Services, Directives+Controllers=Components === Typescript === * TypeScript is not required, but is almost universally assumed in @@ -98,6 +91,8 @@ set foo(str: String): void {this.foo = str} *** Final build only contains french strings. ** can drop the egStrings module ** keeping all files within the Ang2 universe makes things like IDEs possible + ** In the works for 5.x: translations for strings /in typescript code/ -- woohoo. + *** https://github.com/angular/angular/issues/11405 === Services and Classes === * Many services can just be classes @@ -134,9 +129,12 @@ import * as $ from 'jquery'; } ------------------------------------------------------------------------ +== Integrated service workers + * Not yet researched + == Configure Apache for lazy-loading / nested modules -* Assumes ng-build is compiling to /openils/var/web/ang2 (or symlinked) +* Assumes ng-build is compiling to /openils/var/web/e2 (or symlinked) * Another nod toward going all angular .html / no TT2 or EGWeb required. == Nested routing @@ -146,6 +144,11 @@ import * as $ from 'jquery'; Resolvers proceed as expected, from the base components out to the children. +* egStartup.go() is broken out into route-specific data fetching / + it cascades down to each app: + + ** load idl => verify auth / load common staff data => load app-specficic data. + * Base routes defined in root, child routes defined in child routing module, and on down. @@ -197,9 +200,25 @@ directive. * Install Evergreen working/lp1626157-ang2-sandbox * Edit eg_vhost.conf (see fallback resource above) -* mkdir Open-ILS/web/webby -* opensrf: ln -s /home/berick/code/Evergreen/Open-ILS/web/webby /openils/var/web/webby +* mkdir Open-ILS/web/eg2 +* opensrf: ln -s /home/berick/code/Evergreen/Open-ILS/web/eg2 /openils/var/web/eg2 * sudo npm install -g @angular/cli -* cd Open-ILS/webby-src +* cd Open-ILS/eg2-src * npm install -* ng build --deploy-url /webby/ --base-href /webby/ --output-path ../web/webby/ --watch +* ng build --deploy-url /eg2/ --base-href /eg2/ --output-path ../web/eg2/ --watch + +== + +In a way, we're on a journey alongside the angular team. have a chance +to review the /eg/ work and reassess some things. + +* many deps are the same as we're already using -- jasmine, karma + +== Integrationg JS to angjs + * main thing is +[source,js] +------------------------------------------------------------------------- +var service = {}; +var service: any = {}; +# branch user/berick/lp1626157-webstaff-typescript +------------------------------------------------------------------------- -- 2.11.0