2018-11-26

Scala MatchError scala.collection.immutable.$colon$colon

I got an error while writing a Scala Combinator Parser:
MatchError: ... scala.collection.immutable.$colon$colon
I didn't understand anything until I found there is a list called "::"
$colon$colon
All that was need was to use .toList to get an ordinary list.

2018-11-21

Rachel Maddow on The New York Times article about Khashoggi

Interesting to watch Rachel Maddow talk about New York Times article about Khashoggi citing:

"From Trump's failure to condemn white supremacist violence in Charlotesville to mocking a sexual assault victim, there have been many low points of this presidency. But turning a blind eye to the butchering of a U.S.-based journalist just may be one of the lowest."

2018-10-28

Foundation 6 with AngularJS 1.7.5

Foundation 6 with AngularJS 1.7.5

Angular directives for Foundation was only tested with 1.5 and I implemented some examples as components:
  • Accordions
  • Alerts
  • Buttons
  • Modals
  • Orbits
  • Tabs

Repository

You can find it here:

AngularJS Material Examples as Components

AngularJS Material Examples as Components

Made a single page with AngularJS Material examples as components:
  • Buttons
  • Checkboxes
  • Cards
  • Dialogs
  • Grids
  • Icons
  • Form with errors
  • Radios
  • Selects
  • Sliders
  • Swipes
  • Switches
  • Tabs

Repository

You can find it here:

2018-10-27

UIBootstrap Examples as AngularJS Components

UIBootstrap Examples as AngularJS Components

I was interested in learning UIBootstrap since it's tricky to use Foundation with AngularJS.

Included Examples

Not all examples are included (but it shouldn't be any problem adding them):

  1. Accordion
  2. Alert
  3. Buttons
  4. Carousel
  5. Collapse
  6. Datepicker
  7. Dropdown
  8. Modal
  9. Tabs

GITHub

Re-wrote some UIBootstrap examples to AngularJS components. You can find them here

2018-09-20

Updated Scala Stack With Angular

News

Updated Scala Stack with Angular and made it cleaner. It uses a servlet with a Scala JS compiler to compile ScalaJS code on the fly!

About

Scala Stack is using Google App Engine, Maven and AngularJS, but only with Scala code! Both backend and frontend is written in Scala. HTML and CSS is generated from Scala code.
Note that no pre-processors or SBT are used. Backend compiles at publish and Javascripts at startup.
You can read more at my earlier blog post:

Repository

Check it out:

2018-03-12

Bind from parent component to child (AngularJS)

Bind from Parent Component to Child

Simple example of how to one-way bind from parent component to child. The child component will be able to use the parent's data.


2018-01-02

Compiling JavaScript on Serverside With Scala and ScalaJS using Google Standard App Engine

Compiling JavaScript on Serverside With Scala and ScalaJS using Google Standard App Engine 

Since my experience with the JavaScript world and exploration of ScalaJS I felt compelled to move from Node and Grunt and try to fully utilize Scala for both front and back.
I reached a goal with Scala Stack, a concept of creating all web content on serverside using only Scala code. The concept is extended to keep everything in code including configuration to be fully testable.

Obvious Advantages

My main purpose was to skip the JavaScript world but it moved on to something much larger. If all code is shared there are quite a few advantages
  • Single, isomorphic source which ease work and can share logic
  • Share data by keeping it in code. For instance languages could be defined with a Enum type
  • Fully testable code
  • No JavaScript package manager like NPM or WebPack
  • No pre processor like Gulp or Grunt
  • No SBT since the compilation is with a simple Servlet  

Risks

There are some traps though 
  • Security, some code should not be shared between backend and frontend
  • Long term effects, demands an experienced architect 
  • Shared code needs to be ScalaJS compatible and cannot use backend dependencies since it's compiled and used on frontend

Scala Stack

Map of Scala Stack

I've made three implementations using Google Standard Environment with Java 8. Implemented in native JavaScript, jQuery and AngularJS.
Goal is to keep everything in code and to avoid configuration, annotations and settings in Strings.
By only using Scala on serverside, it produce HTML, CSS and JavaScript which is all components for a webpage. 

Scala Stack with Angular

You find links to code and running example below

Servlet Compiler

Scala Stack is using a Servlet compiler with different logging: