{"id":2747,"date":"2015-03-27T12:15:35","date_gmt":"2015-03-27T10:15:35","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=2747"},"modified":"2015-03-18T10:24:19","modified_gmt":"2015-03-18T08:24:19","slug":"creating-angularjs-application-without-javascript-scalajs","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/","title":{"rendered":"Creating an Angular.js application without JavaScript: Scala.js"},"content":{"rendered":"<p>In my day job I work a lot with Angular.js. And while this is a great framework, sometimes I do miss the type-safety and advanced features of languages such as Scala. Getting &#8220;undefined is not a function&#8221; is not the the most informative error message you get when developing JavaScript applications.<\/p>\n<p>A couple of weeks ago I ran across a twitter message showing that Scala.js 0.60 (<a href=\"http:\/\/www.scala-js.org\/\">http:\/\/www.scala-js.org\/<\/a>) was released. With Scala.js you can compile Scala directly to JavaScript. So you can use all the advanced library and language features of Scala, and create JavaScript applications in a typesafe, functional manner!<\/p>\n<p>So for this article I&#8217;ll show you the steps I went through to create a minimal Angular.js application using nothing but Scala (and some HTML templates of course).<\/p>\n<p><a href=\"http:\/\/www.smartjava.org\/examples\/scalajs\/html\/index-dev.html#\/home\">http:\/\/www.smartjava.org\/examples\/scalajs\/html\/index-dev.html#\/home<\/a><\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/Minimal_angular_js.png\"><img decoding=\"async\" class=\"aligncenter wp-image-2761\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/Minimal_angular_js-1024x624.png\" alt=\"Minimal_angular_js\" width=\"850\" height=\"518\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/Minimal_angular_js-1024x624.png 1024w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/Minimal_angular_js-300x183.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/03\/Minimal_angular_js.png 1120w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/a><\/p>\n<p>This Angular \/ Scala.js app will show the following features:<\/p>\n<ul>\n<li>Controllers written in Scala<\/li>\n<li>Directives written in Scala<\/li>\n<li>Filters written in Scala<\/li>\n<li>Use the Angular.js route module for handling URL paths<\/li>\n<li>Use foundation for templating<\/li>\n<\/ul>\n<p>You can find the complete sources for this application in GitHub (<a href=\"https:\/\/github.com\/josdirksen\/smartjava\/tree\/master\/scalajs\">https:\/\/github.com\/josdirksen\/smartjava\/tree\/master\/scalajs<\/a>).<\/p>\n<h3>Lets get started<\/h3>\n<p>The first thing we need to do is make sure we have node.js installed. This isn&#8217;t really necessary but will speed up development considerably. So install node.js from here (<a href=\"https:\/\/nodejs.org\/download\/\">https:\/\/nodejs.org\/download\/<\/a>) before you continue. To work with Scala.js we have to install an sbt plugin. In the file plugins.sbt in the project directory add the following line:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">addSbtPlugin('org.scala-js' % 'sbt-scalajs' % '0.6.0')<\/pre>\n<p>Note that I&#8217;ve tested this with sbt 0.13.7, so make sure you&#8217;ve got a current version of sbt installed. Next lets look at the build.sbt file we&#8217;ve used for this project:<\/p>\n<pre class=\"brush: scala; title: ; notranslate\" title=\"\">\r\nenablePlugins(ScalaJSPlugin)\r\n\r\nname := &quot;scalajs&quot;\r\n\r\nversion := &quot;1.0&quot;\r\n\r\nscalaVersion := &quot;2.11.5&quot;\r\n\r\nlibraryDependencies += &quot;org.scala-js&quot; %%% &quot;scalajs-dom&quot; % &quot;0.8.0&quot;\r\nlibraryDependencies += &quot;com.greencatsoft&quot; %%% &quot;scalajs-angular&quot; % &quot;0.4-SNAPSHOT&quot;\r\n\r\nresolvers +=\r\n  &quot;Sonatype OSS Snapshots&quot; at &quot;https:\/\/oss.sonatype.org\/content\/repositories\/snapshots&quot;\r\n\r\njsDependencies += &quot;org.webjars&quot; % &quot;angularjs&quot; % &quot;1.3.14&quot; \/ &quot;angular-route.js&quot; dependsOn &quot;angular.js&quot;\r\njsDependencies += &quot;org.webjars&quot; % &quot;angularjs&quot; % &quot;1.3.14&quot; \/ &quot;angular.js&quot;\r\njsDependencies += &quot;org.webjars&quot; % &quot;angular-foundation&quot; % &quot;0.3.0&quot; \/ &quot;mm-foundation.js&quot;\r\njsDependencies += &quot;org.webjars&quot; % &quot;angular-foundation&quot; % &quot;0.3.0&quot; \/ &quot;mm-foundation-tpls.js&quot;\r\n\r\npersistLauncher in Compile := true\r\npersistLauncher in Test := false\r\n\r\nskip in packageJSDependencies := false <\/pre>\n<p>In this build.sbt you can see the following:<\/p>\n<ol>\n<li>We enable the scalaJS Plugin<\/li>\n<li>We include a couple of Scala.js dependencies like we normally do for scala<\/li>\n<li>We also include a number of jsDependencies. These are the JavaScript libraries we want to use in our web application<\/li>\n<li>And finally we configure how the application will be packaged. More on that later<\/li>\n<\/ol>\n<p>Lets look a bit at the last couple of lines of this build file:<\/p>\n<pre class=\"brush: scala; title: ; notranslate\" title=\"\">\r\npersistLauncher in Compile := true\r\nskip in packageJSDependencies := false <\/pre>\n<p>By setting the persistLauncher to true, we tell Scala.js to create the JavaScript that will automatically launch our application and by setting skip in packageJSDependencies to false, we tell Scala.js to package all our external JavaScript files into one big library for easy inclusion in your HTML page.<\/p>\n<p>Before we look at the Scala code and the HTML templates lets first look at a couple of useful SBT commands. Go to the directory where your project is and run sbt to open the sbt console:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">jos@Joss-MacBook-Pro.local:~\/git\/scalajs$ sbt\r\n&#x5B;info] Set current project to scalajs (in build file:\/Users\/jos\/git\/scalajs\/)<\/pre>\n<p>Now to generate the JavaScript code, we first have to enable node.js so that creating the JavaScript goes a whole lot quicker. In the sbt console set the following:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&gt; set scalaJSStage in Global := FastOptStage\r\n&#x5B;info] Defining *\/*:scalaJSStage\r\n&#x5B;info] The new value will be used by compile:jsEnv, compile:scalaJSExecClasspath and 1 others.\r\n&#x5B;info]  Run `last` for details.\r\n&#x5B;info] Reapplying settings...\r\n&#x5B;info] Set current project to scalajs (in build file:\/Users\/jos\/git\/scalajs\/)\r\n&gt;<\/pre>\n<p>Now you can compile the Scala to JavaScript by calling fastOptJS<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&gt;  fastOptJS\r\n&#x5B;warn] The global sbt directory is now versioned and is located at \/Users\/jos\/.sbt\/0.13.\r\n&#x5B;warn]   You are seeing this warning because there is global configuration in \/Users\/jos\/.sbt but not in \/Users\/jos\/.sbt\/0.13.\r\n&#x5B;warn]   The global sbt directory may be changed via the sbt.global.base system property.\r\n&#x5B;info] Fast optimizing \/Users\/jos\/git\/scalajs\/target\/scala-2.11\/scalajs-fastopt.js\r\n&#x5B;success] Total time: 7 s, completed Mar 8, 2015 8:01:31 AM<\/pre>\n<p>Enough about SBT, lets look at the Scala code<\/p>\n<h3>Angular App in Scala<\/h3>\n<p>The complete file can be found in Git (<a href=\"https:\/\/github.com\/josdirksen\/smartjava\/tree\/master\/scalajs\">https:\/\/github.com\/josdirksen\/smartjava\/tree\/master\/scalajs<\/a>) so we won&#8217;t show that here. We&#8217;ll just look at the interesting parts. Before we look at the JavaScript though, lets look at the HTML templates:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html ng-app=&quot;helloworld&quot;&gt;\r\n&lt;head&gt;\r\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n    &lt;title&gt;Minimal angular.js&lt;\/title&gt;\r\n    &lt;link rel=&quot;stylesheet&quot; href=&quot;css\/foundation.css&quot; \/&gt;\r\n    &lt;style&gt;\r\n        .tile {\r\n            background: #ffeeee;\r\n        }\r\n    &lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n \r\n&lt;div class=&quot;row&quot;&gt;\r\n    &lt;div class=&quot;large-12 columns&quot;&gt;\r\n        &lt;h1&gt;Sample angular.js \/ foundation \/ scala.js app&lt;\/h1&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n \r\n&lt;div ng-view&gt;&lt;\/div&gt;\r\n \r\n&lt;!-- Include Scala.js compiled code --&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;..\/..\/..\/target\/scala-2.11\/scalajs-fastopt.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;..\/..\/..\/target\/scala-2.11\/scalajs-jsdeps.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;..\/..\/..\/target\/scala-2.11\/scalajs-launcher.js&quot;&gt;&lt;\/script&gt;\r\n \r\n&lt;\/body&gt;\r\n \r\n&lt;\/html&gt; <\/pre>\n<p>This file is our main index file. As you can see, not that special. Just a single div where we have an ng-view. What is interesting are the three JavaScript files at the bottom of the page. These are generated by Scala.js and contain all our code:<\/p>\n<ul>\n<li>scalajs-fastopt.js: our compiled application.<\/li>\n<li>scalajs-jsdeps.js: all dependencies as a single file<\/li>\n<li>scalajs-launcher.js: code that will launch our application when the page is loaded<\/li>\n<\/ul>\n<p>We have two additional HTML files, one that is shown as the main page in the ng-view we just saw, and one that is used as the tiles you saw in the beginning of this article:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html ng-app=&quot;helloworld&quot;&gt;\r\n&lt;head&gt;\r\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n    &lt;title&gt;Minimal angular.js&lt;\/title&gt;\r\n    &lt;link rel=&quot;stylesheet&quot; href=&quot;css\/foundation.css&quot; \/&gt;\r\n    &lt;style&gt;\r\n        .tile {\r\n            background: #ffeeee;\r\n        }\r\n    &lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n \r\n&lt;div class=&quot;row&quot;&gt;\r\n    &lt;div class=&quot;large-12 columns&quot;&gt;\r\n        &lt;h1&gt;Sample angular.js \/ foundation \/ scala.js app&lt;\/h1&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n \r\n&lt;div ng-view&gt;&lt;\/div&gt;\r\n \r\n&lt;!-- Include Scala.js compiled code --&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;..\/..\/..\/target\/scala-2.11\/scalajs-fastopt.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;..\/..\/..\/target\/scala-2.11\/scalajs-jsdeps.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;..\/..\/..\/target\/scala-2.11\/scalajs-launcher.js&quot;&gt;&lt;\/script&gt;\r\n \r\n&lt;\/body&gt;\r\n \r\n&lt;\/html&gt; <\/pre>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;p simple-directive=&quot;some configuration&quot;&gt;&lt;\/p&gt; <\/pre>\n<p>So now that we&#8217;ve seen the HTML, it is time for the actual code. The first part we&#8217;ll look at is the starting point of any Angular application, the module configuration:<\/p>\n<pre class=\"brush: scala; title: ; notranslate\" title=\"\">\r\nobject HelloWorld extends JSApp {\r\n \r\n  def main(): Unit = {\r\n    val module = Angular.module(&quot;helloworld&quot;,Seq(&quot;ngRoute&quot;,&quot;mm.foundation&quot;))\r\n    module.controller(HomeController)\r\n    module.config(RoutingConfig)\r\n    module.filter(ToUpperFilter)\r\n    module.filter(IntDoublerFilter)\r\n    module.directive(SimpleDirective)\r\n  }\r\n} <\/pre>\n<p>Here we define our Angular module (named helloworld) and add two dependencies: ngRoute and mm.foundation. ngRoute provides us with a way to easily configure URL mapping to templates and controllers, and mm.foundation (<a href=\"https:\/\/github.com\/pineconellc\/angular-foundation\/tree\/gh-pages\">https:\/\/github.com\/pineconellc\/angular-foundation\/tree\/gh-pages<\/a>) provides us with directives that map to foundation (<a href=\"http:\/\/foundation.zurb.com\/\">http:\/\/foundation.zurb.com\/<\/a>) widgets.<\/p>\n<p>Next we link to the controllers, filters, directives, config objects we want to use in this app. Note that these are all statically typed, so you can&#8217;t forget or register angular components incorrectly. In this example we have five additional components, lets look at each one. First lets look at the RoutingConfig:<\/p>\n<pre class=\"brush: scala; title: ; notranslate\" title=\"\">\r\nobject RoutingConfig extends Config {\r\n \r\n  @inject\r\n  var routeProvider: RouteProvider = _\r\n \r\n  override def initialize() {\r\n    routeProvider\r\n      .when(&quot;\/home&quot;, Route(HomeController))\r\n  }\r\n} <\/pre>\n<p>As you can see, this is very easy and pretty much the same as you&#8217;d do it in JavaScript. The main difference is that instead of providing string values in JavaScript we now just reference a specific controller to use for a path.This controller, which we registered earlier, looks like this:<\/p>\n<pre class=\"brush: scala; title: ; notranslate\" title=\"\">\r\nobject HomeController extends PageController {\r\n \r\n  import js.JSConverters._\r\n \r\n  val templateUrl = &quot;templates\/home.html&quot;\r\n  override type ScopeType = ControllerData\r\n \r\n  @inject\r\n  var service: Interval = _\r\n \r\n  override def initialize(scope: ScopeType): Unit = {\r\n    scope.title = &quot;This is the title&quot;\r\n    scope.subTitle = &quot;Make Me Big&quot;\r\n \r\n    scope.anotherScope = 1 to 12 toJSArray\r\n \r\n    service.apply( () =&gt; scope.count = System.currentTimeMillis() % 10000, 100)\r\n  }\r\n \r\n  \/**\r\n   * The specific scope data used in this controller\r\n   *\/\r\n  trait ControllerData extends Scope {\r\n    var title: String = js.native\r\n    var subTitle: String = js.native\r\n    var count: Double = js.native\r\n \r\n    var anotherScope: js.Array&#x5B;Int] = js.native\r\n  }\r\n} <\/pre>\n<p>I won&#8217;t go into too much detail here, since the code is pretty self-explanatory. What you can see here is that we define the template that we want to show (when the url from the route is accessed), we setup some scope variables (all typed!) and start an interval using the injected Interval service.<\/p>\n<p>If you&#8217;ve looked through the pages you can also see we use a number of filters. Defining a filter in Scala.js is really easy:<\/p>\n<pre class=\"brush: scala; title: ; notranslate\" title=\"\">\r\n\/**\r\n * Simple filter: text to uppercase\r\n *\/\r\nobject ToUpperFilter extends Filter {\r\n  override val name = &quot;upper&quot;\r\n  override def filter(text: String): String = text.toUpperCase\r\n}\r\n \r\n\/**\r\n * Simple filter: double a value\r\n *\/\r\nobject IntDoublerFilter extends Filter {\r\n  override val name = &quot;double&quot;\r\n  override def filter(text: String): String = text.toInt*2 toString\r\n} <\/pre>\n<p>And finally we have a directive which we use in tile.html.<\/p>\n<pre class=\"brush: scala; title: ; notranslate\" title=\"\">\r\nobject SimpleDirective extends AttributeDirective {\r\n \r\n  override val name = &quot;simpleDirective&quot;\r\n \r\n  @JSExportAll\r\n  case class Address(ip : String)\r\n \r\n  override def link(scope: ScopeType, elems: Seq&#x5B;Element], attrs: Attributes, controller: Controller*) = {\r\n    val elem = elems.head.asInstanceOf&#x5B;HTMLElement]\r\n    elem.textContent = &quot;Some content set from the directive&quot;\r\n  }\r\n} <\/pre>\n<p>When you compile this application to JavaScript using sbt and open the HTML pages you&#8217;ll get what we showed in the beginning. A very basic Angular.js application with custom filters, directives and two Angular extensions.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/www.smartjava.org\/content\/creating-angularjs-application-without-javascript-scalajs\">Creating an Angular.js application without JavaScript: Scala.js<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Jos Dirksen at the <a href=\"http:\/\/www.smartjava.org\/\">Smart Java<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In my day job I work a lot with Angular.js. And while this is a great framework, sometimes I do miss the type-safety and advanced features of languages such as Scala. Getting &#8220;undefined is not a function&#8221; is not the the most informative error message you get when developing JavaScript applications. A couple of weeks &hellip;<\/p>\n","protected":false},"author":11,"featured_media":920,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[115],"class_list":["post-2747","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-scala-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating an Angular.js application without JavaScript: Scala.js - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In my day job I work a lot with Angular.js. And while this is a great framework, sometimes I do miss the type-safety and advanced features of languages\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating an Angular.js application without JavaScript: Scala.js - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In my day job I work a lot with Angular.js. And while this is a great framework, sometimes I do miss the type-safety and advanced features of languages\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-03-27T10:15:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jos Dirksen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jos Dirksen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/\"},\"author\":{\"name\":\"Jos Dirksen\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/85292631fddd881f88ab3b10d8257505\"},\"headline\":\"Creating an Angular.js application without JavaScript: Scala.js\",\"datePublished\":\"2015-03-27T10:15:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/\"},\"wordCount\":1903,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"keywords\":[\"Scala.js\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/\",\"name\":\"Creating an Angular.js application without JavaScript: Scala.js - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"datePublished\":\"2015-03-27T10:15:35+00:00\",\"description\":\"In my day job I work a lot with Angular.js. And while this is a great framework, sometimes I do miss the type-safety and advanced features of languages\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Creating an Angular.js application without JavaScript: Scala.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/85292631fddd881f88ab3b10d8257505\",\"name\":\"Jos Dirksen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g\",\"caption\":\"Jos Dirksen\"},\"sameAs\":[\"http:\/\/www.smartjava.org\/\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/jos-dirksen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating an Angular.js application without JavaScript: Scala.js - Web Code Geeks - 2026","description":"In my day job I work a lot with Angular.js. And while this is a great framework, sometimes I do miss the type-safety and advanced features of languages","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/","og_locale":"en_US","og_type":"article","og_title":"Creating an Angular.js application without JavaScript: Scala.js - Web Code Geeks - 2026","og_description":"In my day job I work a lot with Angular.js. And while this is a great framework, sometimes I do miss the type-safety and advanced features of languages","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-03-27T10:15:35+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","type":"image\/jpeg"}],"author":"Jos Dirksen","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Jos Dirksen","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/"},"author":{"name":"Jos Dirksen","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/85292631fddd881f88ab3b10d8257505"},"headline":"Creating an Angular.js application without JavaScript: Scala.js","datePublished":"2015-03-27T10:15:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/"},"wordCount":1903,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","keywords":["Scala.js"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/","name":"Creating an Angular.js application without JavaScript: Scala.js - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","datePublished":"2015-03-27T10:15:35+00:00","description":"In my day job I work a lot with Angular.js. And while this is a great framework, sometimes I do miss the type-safety and advanced features of languages","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/creating-angularjs-application-without-javascript-scalajs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"Creating an Angular.js application without JavaScript: Scala.js"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/85292631fddd881f88ab3b10d8257505","name":"Jos Dirksen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bc7ecab0b9c4dcc3d53ae3554532370b976da88a8e2421d8148b06da11bb13e0?s=96&d=mm&r=g","caption":"Jos Dirksen"},"sameAs":["http:\/\/www.smartjava.org\/"],"url":"https:\/\/www.webcodegeeks.com\/author\/jos-dirksen\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/2747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=2747"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/2747\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/920"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=2747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=2747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=2747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}