GithubHelp home page GithubHelp logo

lppedd / angular-kotlin-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidpodhola/angular-kotlin-starter

1.0 3.0 0.0 25.49 MB

A starter app for using Angular, Webpack, and Typescript/ESNext decorators with Kotlin

JavaScript 99.70% HTML 0.04% Kotlin 0.22% CSS 0.05%

angular-kotlin-starter's Introduction

Angular-Kotlin Starter App

Not only is this a starter app, but also an instruction on how to use TypeScript/ESNext decorators with Kotlin.

First, glance through this post on stack overflow so you get a better understanding of how decorators work:

https://stackoverflow.com/questions/29775830/how-to-implement-a-typescript-decorator

Then look at the classes in the io.angular.sample.wrapper package to see how to use a decorator in Kotlin.

To be more specific, look at line 141 of Component.kt to see the @Component decorator being used. In this case it is renamed to NgComponent and is imported in the Angular.kt file in the io.angular.sample.external package.

Each class in the io.angular.sample.wrapper package uses their corresponding decorators in the initialize() extension function.


This app uses the following libraries together:

- Angular 4
- Kotlin
- Onsenui Angular components
- Webpack (with a modified version of huston007's kotlin-loader)

Note that the current output bundle size is huge, after taking it through minification and the new Kotlin-js dead code elimination tool the size should be reduced dramatically.

https://discuss.kotlinlang.org/t/a-new-dead-code-elimination-tool-for-js/3777

To setup the project do:

> npm install

Also make sure the Kotlin compiler bin folder is on your path environment variable.
The Kotlin compiler must be the same version of Kotlin that is in package.json.

If you are using IntelliJ and want to use the compiler that comes with the Kotlin plugin
just do a system wide search for 'kotlinc-js' and put the bin folder it finds on your path.

For instance mine is C:\Users\gbaldeck\.IntelliJIdea2017.2\config\plugins\Kotlin\kotlinc\bin

To run the project do:

> npm run build
> npm run serve
Navigate to localhost:8080

Then when you make changes do:

> npm run build
Refresh the browser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.