All Projects → jokade → Angulate2

jokade / Angulate2

Licence: mit
Scala.js bindings for Angular

Programming Languages

scala
5932 projects
scalajs
39 projects

Labels

Projects that are alternatives of or similar to Angulate2

ncg-crud-ngx-md
Angular 4+ Material Design CRUD/Admin app by NinjaCodeGen http://DNAfor.NET
Stars: ✭ 36 (-59.09%)
Mutual labels:  angular-2
Learnapollo
👩🏻‍🏫 Learn Apollo - A hands-on tutorial for Apollo GraphQL Client (created by Graphcool)
Stars: ✭ 5,274 (+5893.18%)
Mutual labels:  angular-2
Root Bootstrap 4 Admin Template With Angularjs Angular 2 Support
Root is Boostrap 4 Admin Template with Angular 2 and AngularJS support
Stars: ✭ 54 (-38.64%)
Mutual labels:  angular-2
angular-esri-components
A set of Angular components to work with ArcGIS API for JavaScript v4.6
Stars: ✭ 43 (-51.14%)
Mutual labels:  angular-2
Bootstraping Ngx Admin Lte
Angular2,4,6 project with AdminLTE dashboard template (using angular, angular-cli and ngx-admin-lte ) Formerly called 'ng2-admin-lte'.
Stars: ✭ 479 (+444.32%)
Mutual labels:  angular-2
Videogular2
The HTML5 video player for Angular 2
Stars: ✭ 678 (+670.45%)
Mutual labels:  angular-2
angular-gulp-starter
Simple dev/prod build for Angular (2+) using gulp, systemjs, rollup, ngc (AOT), scss, Visual Studio
Stars: ✭ 18 (-79.55%)
Mutual labels:  angular-2
Ng4 Loading Spinner
Angular 4 custom async loading spinner.
Stars: ✭ 74 (-15.91%)
Mutual labels:  angular-2
Mydatepicker
Angular 2+ date picker
Stars: ✭ 558 (+534.09%)
Mutual labels:  angular-2
Ngx.leaflet.component
angular 2+ / leaflet 1.x component collection
Stars: ✭ 46 (-47.73%)
Mutual labels:  angular-2
Ngx Responsive
Superset of RESPONSIVE DIRECTIVES to show or hide items according to the size of the device screen and another features in Angular 9
Stars: ✭ 300 (+240.91%)
Mutual labels:  angular-2
Kendo Angular
Issue tracker - Kendo UI for Angular
Stars: ✭ 352 (+300%)
Mutual labels:  angular-2
Ngx Restangular
Restangular for Angular 2 and higher versions
Stars: ✭ 787 (+794.32%)
Mutual labels:  angular-2
ng2-timezone-selector
A simple Angular module to create a timezone selector using moment-timezone.
Stars: ✭ 12 (-86.36%)
Mutual labels:  angular-2
Burrowui
This is a NodeJS/Angular 2 frontend UI for Kafka cluster monitoring with Burrow
Stars: ✭ 69 (-21.59%)
Mutual labels:  angular-2
awesome-libraries-resources
Awesome js and css libraries for web development.
Stars: ✭ 32 (-63.64%)
Mutual labels:  angular-2
Guides
Article back-end for hack.guides() website
Stars: ✭ 628 (+613.64%)
Mutual labels:  angular-2
Coreui Free Angular Admin Template
CoreUI Angular is free Angular 2+ admin template based on Bootstrap 4
Stars: ✭ 1,279 (+1353.41%)
Mutual labels:  angular-2
Egeo
EGEO is the open-source UI library used to build Stratio's UI. It includes UI Components, Utilities, Services and much more to build user interfaces quickly and with ease. The library is distributed in AoT mode.
Stars: ✭ 69 (-21.59%)
Mutual labels:  angular-2
Dejajs Components
Angular components
Stars: ✭ 37 (-57.95%)
Mutual labels:  angular-2

angulate2

Gitter Scala.js

Scala.js bindings for Angular. The goal is to provide an API/ experience very similar to the TypeScript API of Angular.

IMPORTANT: angulate2 currently only supports Scala 2.11.x

A basic Quickstart Example that may serve as template is available, as well as set of extended examples.

Release Notes

Getting Started

SBT settings

Add the following lines to your project/plugins.sbt:

addSbtPlugin("de.surfice" % "sbt-angulate2" % "0.1.0-RC1")

and this to your build.sbt:

enablePlugins(Angulate2Plugin)

ngBootstrap := Some("AppModule") //qualified name (including packages) of Scala class to bootstrap

The current version of angulate2 is built for Angular 4 and Scala.js 0.6.18.

Create application module and component

import angulate2.std._
import angulate2.platformBrowser.BrowserModule

@NgModule(
  imports = @@[BrowserModule],
  declarations = @@[AppComponent],
  bootstrap = @@[AppComponent]
)
class AppModule {}

@Component(
  selector = "my-app",
  template = "<h1>{{greeting}}</h1>
}
class AppComponent {
  val greeting = "Hello Angular!"
}

Build and run with System.js

With the above configuration, a separate JS file PROJECT-sjsx.js is written to target/scala-2.11/ every time you run fastOptJS or fullOptJS. This file contains the class decorators generated from Angular2 annotations (@Component, ...) and represents the entry module of your Angular application. The annotations file loads the Scala.js package and all Angular libraries via require, so you need to load the annotations file with a module loader.

One way to achieve this is to use (System.js)[https://github.com/systemjs/systemjs]. The angulate2 sbt plugin provides some tasks to simplify the creation of the System.js configuration, and for running (lite-server)[https://github.com/johnpapa/lite-server]. Although you can build your angulate2 project without Node.js, some of these tasks require a Node.js installation, so make sure npm and node are in your PATH before you proceed.

Add the HTML index

Create src/main/resources/index-fastopt.html with the following content:

<html>
  <head>
    <title>Angulate2 QuickStart</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- <link rel="stylesheet" href="styles.css"> -->
    <!-- 1. Load libraries -->
    <!-- Polyfill for older browsers -->
    <script src="node_modules/core-js/client/shim.min.js"></script>
    <script src="node_modules/zone.js/dist/zone.js"></script>
    <script src="node_modules/reflect-metadata/Reflect.js"></script>
    <script src="node_modules/systemjs/dist/system.src.js"></script>
    <!-- 2. Configure SystemJS -->
    <script src="systemjs-fastopt.config.js"></script>
    <script>
      System.import('app').catch(function(err){ console.error(err); });
    </script>
  </head>
  <!-- 3. Display the application -->
  <body>
    <my-app>Loading...</my-app>
  </body>
</html>

Create the System.js configuration

Most of the settings required for System.js config file are pre-configured by the angulate2 sbt plugin; however, you need to add the following System.js module mappings to your build.sbt:

    systemJSMappings in fastOptJS ++= Seq(
      "@angular/core"                     -> "npm:@angular/core/bundles/core.umd.js",
      "@angular/common"                   -> "npm:@angular/common/bundles/common.umd.js",
      "@angular/compiler"                 -> "npm:@angular/compiler/bundles/compiler.umd.js",
      "@angular/platform-browser"         -> "npm:@angular/platform-browser/bundles/platform-browser.umd.js",
      "@angular/platform-browser-dynamic" -> "npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js",
      "@angular/http"                     -> "npm:@angular/http/bundles/http.umd.js",
      "@angular/router"                   -> "npm:@angular/router/bundles/router.umd.js",
      "@angular/forms"                    -> "npm:@angular/forms/bundles/forms.umd.js",
      "@angular/upgrade"                  -> "npm:@angular/upgrade/bundles/upgrade.umd.js",
      "rxjs"                              -> "npm:rxjs"
    )

then run sbt fastOptJS::systemJS. This creates the System.js configuration at target/scala-2.11/systemjs-fastopt.config.js.

Create lite-server configuration

Next run sbt fastOptJS::liteServerWriteConfigFile. This will install all required npm dependencies (which may take some time), copy your index-fastopt.html to target/scala-2.11/, and create bs-config-fastopt.json (the lite-server configuration).

Compile and run project

Run sbt fastOptJS; this will build the Scala.js application file (angulate2-quickstart-fastopt.js) and the corresponding decorator file (angulate2-quickstart-sjsx.js). To run you project, start

$ node_modules/lite-server/bin/lite-server --config=target/scala-2.11/bs-config-fastopt.json

from your shell, and point your browser to http://localhost:3000/index-fastopt.html.

Bundle the application with webpack

TBD

License

This code is open source software licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].