carltonf / ng2-heros

learning angular 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular2 Pitfalls

@Component::moduleId

set this to use relative paths for component assets.

Silent failures

When it fails silents, usually it’s related to the DOM, here I list some cases I’ve come over.

  • Pay close attention to inputs/outputs spelling

Make tabs an independent module for reuse

An npm module preferred. Most web resources are outdated.

A warning on local module testing

It’s tempting to have tabs install from a local directory. But there are some issues associated. Suggestion timoxley/linklocal.

About the package.json and tsconfig.json

tsconfig.json is always needed. Refer to ng2-heroes for a sample.

In package.json, there is the typings field to set. Refer to Typings for npm packages · Microsoft/TypeScript Wiki for details.

Some Notes

lite-server

  • Avoid opening a new browser window

    There is an ongoing issue about exposing browser-sync’s configuration objects in command line.

    For now, add open: false to sync.init in lite-server.js.

TODO Use our own server

lite-server doesn’t really have any fancy features, use our own! browser-sync looks quite interesting though (so we don’t need our custom SSE).

About

learning angular 2


Languages

Language:TypeScript 74.5%Language:HTML 17.4%Language:CSS 6.0%Language:JavaScript 2.1%