ds for menu

  • ds
    • label
    • code
    • parent (level)
    • path
    • parameter
    • data
    • component
    • loadChildren
    • canLoad
    • queryParams
    • children
  • how to format the configuration?
  • how is the label translated?
  • code style
    • camel
    • dash
  • convert code from label?
    • replace space with “-“
    • all low case?
Posted in Design | Leave a comment

整合angular-cli 和 nodejs express

use angular-cli to dev the angular project -> build the project -> copy the html file & js files to the express project folders

in nodejs express project, app.js

//app.set(‘view engine’, ‘jade’);
app.engine(‘html’, require(‘ejs’).renderFile);
app.set(‘view engine’, ‘html’);
//app.use(express.static(path.join(__dirname, ‘public’)));
app.use(“/public”, express.static(__dirname + “/public”));

 

 

Posted in Nodejs | Leave a comment

VS Code debug warning

Debugging with legacy protocol because Node xxxx v7.9.x was detected.

=> 在vs code的 launch.json中把 protocol 设成 inspector 即可

 

see https://github.com/Microsoft/vscode/issues/24764

https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_supported-nodelike-runtimes

 

Posted in Nodejs | Leave a comment

debug grails3

  • grails run-app –debug-jvm
  • setup elicpse
  • debug remote java application
    • http://stackoverflow.com/questions/21847441/debug-grails-application-in-eclipse-ide
    • You can start a Grails app (one that has an Eclipse Grails nature, i.e. it was created in STS or was converted via Configure | Convert to Grails Project) in STS in debug mode using Run | Debug As | Grails Command (run-app)

      You can also attach to any app that you start from the commandline via “grails-debug run-app” by creating a Debug Configuration. Go to Run | Debug Configurations and select Remote Java Application. Click the ‘New’ button or right-click the Remote Java Application node and select New. Select the project that you’re debugging and give the configuration a meaningful name (I usually call them “attach “). Change the port from 8000 to 5005, and I always check the “Allow termination of remote VM” checkbox so I can kill the app from the IDE, but that’s optional. Click Debug and it’ll attach. Note that this will work for any Grails project that’s in your workspace, not just ones that have a Grails nature.

Posted in Grails, Uncategorized | Leave a comment

angularjs http cache expire

until the page refresh,

according to this site here are the $cacheFactory specs

  • Storage Javascript heap memory
  • Eviction algorithm Least recently used (LRU)
  • Time-to-live until page refresh
  • Support for revalidation No
  • Requires cooperation of remote server No
Posted in Angularjs, Uncategorized | Leave a comment

bootstrap not run

need to include it in the package,

ie., first line in the bootstrap.groovy need to be “package xxx”

Posted in Grails | Leave a comment

json value (key:value) can not be function

JSON is purely meant to be a data description language. As noted on http://www.json.org, it is a “lightweight data-interchange format.” – not a programming language.

Per http://en.wikipedia.org/wiki/JSON, the “basic types” supported are:

  • Number (integer, real, or floating point)
  • String (double-quoted Unicode with backslash escaping)
  • Boolean (true and false)
  • Array (an ordered sequence of values, comma-separated and enclosed in square brackets)
  • Object (collection of key:value pairs, comma-separated and enclosed in curly braces)
  • null
Posted in JavaScript | Leave a comment