Giter Site home page Giter Site logo

osvaldoj / angular-typescript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pmcalabrese/angular-typescript

0.0 2.0 0.0 217 KB

Tiny Angular version 1 app written in Typescript with modularized Gulp tasks. Perfect as boilerplate.

JavaScript 60.24% TypeScript 23.47% HTML 11.97% CSS 4.33%

angular-typescript's Introduction

Angular Typescript app

Tiny Angular app written in Typescript perfect as boilerplate.

Angular Typescript

Getting started

Prerequisite: You need to have nodejs npm and git installed

  • Clone or download the repo
  • Run sudo npm install -g gulp bower tsd ( install global tools )
  • cd into the project folder
  • Run npm install ( install project specific tools )
  • Run bower install ( install frontend dependency )
  • Run tsd reinstall ( install Typescript definitions )
  • run gulp watch (if you want build and serve the frontend and automatic reload the browser in case of changes, good for development)
  • or gulp ( build frontend ) and gulp serve ( serve the dist folder ).

Note: if you want to change port of the statci server go to gulp_tasks/gulp.serve.js file

TL;DR

###Folder structure

  • src folder contains the source code, here is where you need to work
  • dist folder contains the deployed folder this is what is served when you run gulp serve or gulp watch
  • in the src folder the app is bootstrap in the components/app.ts file
  • in the src folder each component has its own folder containing controller and view. So a home controller will have: components/home/home.ts and components/home/home.html

###Tasks (Gulp)

  • The app use Gulp as task manager, mostly you will use gulp watch and gulp. You can see all the tasks in by running gulp help.
  • The configuration for gulp is in gulp.config.js file.

It supports sourcemaps for Typescript

Angular Typescript

###Frontend library dependency manager (Bower)

  • Third party libs are managed with Bower. It comes down to two basically commands: bower install <package> and bower update. Bower keeps track of these packages in a manifest file, bower.json.

###Typescript

  • This app is written in Typescript.
  • The Typescript Definition are managed by tsd and are downloaded by tsd in the folder typings.
  • For manage type definitions follow the guide on tsd anyway comes down to two main commands tsd install <package> --resolve --save for install and tsd query angular* for search.
  • After you download type definition you need to add the reference the file src/_all.d.ts contains all the type definitions references

Useful resources for learn Typescript and Angualr:

Resources & Articles

Very very good read on folder structure and Style guide

Folder structure

Todd Motto Style guide

John Papa Style guide

Simple Angualr Typescript written by Dan Wahlin

angular-typescript's People

Contributors

joensindholt avatar pmcalabrese avatar

Watchers

 avatar  avatar

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.