Coder Social home page Coder Social logo

antonybudianto / angular-starter Goto Github PK

View Code? Open in Web Editor NEW
524.0 524.0 148.0 2.49 MB

:star: Gulp Angular Starter using TypeScript (Updated to 4.4.3)

Home Page: https://antonybudianto.github.io/angular-starter/

License: MIT License

JavaScript 54.40% TypeScript 30.34% HTML 11.65% CSS 3.61%
angular gulp starter

angular-starter's Introduction

Welcome!

Hi, I'm Antony from Indonesia. I've 8+ years experience on web development from various industry (B2B, HRIS, E-Commerce, Fintech, CRM, Omni-channel).

I spent most of my time on Web development and also learned many other stacks along the journey to understand the whole picture better.

I also sometimes do open-source, and was Google Cloud Certified.

and lastly, Creator of Deesain and StickyNoted.

Some of notable professional achievements:

  • Improved web service reliability and resilience by integrating custom PM2 with Systemd
  • Initiated and supervise in-house SSR React Web Framework and support the migration
  • Initiated autoscaling worker with custom consul DNS to save cost
  • Initiated JavaScript Error Stack parser CLI to help FE team to pinpoint the error location without sourcemap
  • Resolved long standing and high priority issue regarding FCM Notification token issue

Tech stacks:

  • Frontend (React, Vue, Next.js, Nuxt)
  • Backend (Java, Go, Rust)
  • Infrastructure (Docker, Nginx)

Other online profile:


angular-starter's People

Contributors

antonybudianto avatar antonybudianto7 avatar danyhoron avatar darxx avatar jesperronn avatar kennyhyun avatar ndw avatar realsaraf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-starter's Issues

Can`t make breakpoints using debugger in unit test

In chrome browser on port 9876 on break point to analyze code.

Issue Overview

http://prntscr.com/bga96j

Issue Description

add debugger in tests

Reproducables

just try to add debugger in tests and run chrome browser on localhost:9876

Information

Operating System Windows/OSX/Ubuntu/orYourOSHere
Node version 4.x/5.x/orYourNodeVersionHere
NPM Version 2.x/3.x/orYourNPMVersionHere
Environment Browser/Mobile/WebWorker

Couldn't find any of the tags

Failed to inject refresh script! Couldn't find any of the tags [ , ] from C:\Projects..\app\app.html
C:\Projects..\app\navbar\navbar.html
C:\Projects..\app\home\home.html

'gulp test' fails when a spec uses a pipe in template (PhantomJS)

Hi all, I'm running into a problem with gulp test. Whenever a template uses a pipe, I get the following stack trace:
My assumption is that it cannot find the pipe in the spec.

detectChangesInRecords
runDetectChanges
_detectChangesInViewChildren
runDetectChanges
_detectChangesInViewChildren
runDetectChanges
detectChanges
detectChanges
$@/Users/user/Dev/project/node_modules/systemjs/dist/system-polyfills.js:4:15985
H@/Users/user/Dev/project/node_modules/systemjs/dist/system-polyfills.js:4:15614
when@/Users/user/Dev/project/node_modules/systemjs/dist/system-polyfills.js:4:19288
run@/Users/user/Dev/project/node_modules/systemjs/dist/system-polyfills.js:4:18327
_drain@/Users/user/Dev/project/node_modules/systemjs/dist/system-polyfills.js:4:7018
drain@/Users/user/Dev/project/node_modules/systemjs/dist/system-polyfills.js:4:4179
e@/Users/user/Dev/project/node_modules/systemjs/dist/system-polyfills.js:4:10375
run@/Users/user/Dev/project/node_modules/angular2/bundles/angular2-polyfills.js:1243:29
zoneBoundFn@/Users/user/Dev/project/node_modules/angular2/bundles/angular2-polyfills.js:1220:29
_throwError

STEPS TO REPRODUCE:
To reproduce this, try modifying SimplebindComponent to have a date object, and in the template
(simplebind.html), try passing the date to a pipe.

#simplebind.component.ts
export class SimplebindComponent {
    foo = new Date(1988, 3, 15);
    private myname: string;

    constructor() {
        this.myname = 'Simple';
    }
}

Add {{ foo | date }} at the end of simplebind.html

#simplebind.html
{{ foo | date }}

Furthermore, when we console.log the error in the simplebind.component.spec... I get the following printed out:

LOG: ChangeDetectionError{_wrapperMessage: 'ReferenceError: Can't find variable: Intl in [{{ foo | date }} in SimplebindComponent@42:6]', _originalException: ReferenceError{stack: 'format

This is simplebind.component.spec

describe('SimplebindComponent', () => {
    it('should have print "Simple" on template', injectAsync([TestComponentBuilder],
    (tsb: TestComponentBuilder) => {
        return tsb.createAsync(TestComponent).then((fixture) => {
            fixture.detectChanges();
            let compiled = fixture.debugElement.nativeElement;
            expect(compiled).toBeDefined();
            expect(compiled.querySelector('p'))
                .toHaveText('Simple');
        }).catch((err) => {
           console.log(err);
        });
    }));
});

Thank you for the help!

IE11 support ?

This might be more of an angular 2 issue, but here goes:

I've been successfully using your (awesome) angular2-starter with Chrome, Firefox on Win 7. I tested it on IE11 recently, both gulp serve-dev & serve-build fail to bootstrap the app. (stuck at spinner).

Dev tools reported: "Object doesn't support property or method 'keys'", which I figured I needed an es6-shim for. Note: the official angular.io 5 MIN QUICKSTART live example plunkr has the same error with IE11 (https://angular.io/resources/live-examples/quickstart/ts/plnkr.html)

I solved the official angular error through loading the es6-shim via script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.min.js"

However, doing the same to your index.html file does not work. It removes the exception reported in ie11 dev tools, but is still stuck at the spinner (with no errors in console).

How do I get this to work with your build setup ? Is it a SystemJS issue ?

Thanks for such a great tool !!

gulp main task fail at Windows.

Issue Overview

First build after clone gives error: "A project cannot be used in two compilations at the same time. Create multiple projects with createProject instead"

Issue Description

After clone I issued:

npm install
bower install

Next command:

gulp

Gives me error:
Compiling C:\Users\gpolis\Documents\work\ang2\angular2-starter\app\app.component.ts...
C:\Users\gpolis\Documents\work\ang2\angular2-starter\node_modules\gulp-typescript\release\main.js:71
throw new Error('gulp-typescript: A project cannot be used in two compilations at the same time. Create multiple projects with createProject instead.');
^

Error: gulp-typescript: A project cannot be used in two compilations at the same time. Create multiple projects with createProject instead.
at compile (C:\Users\gpolis\Documents\work\ang2\angular2-starter\node_modules\gulp-typescript\release\main.js:71:19)

Reproducables

git clone
npm install
bower install
gulp

Information

Operating System Windows
Node version 4.x
NPM Version 3.x
Environment Browser

Jasmine errors on tsling

Issue Overview

Hi Antony,
I have a problem when I run gulp test, I am getting this error:
node_modules/angular2/src/testing/matchers.d.ts(4,37): error TS2503: Cannot find namespace 'jasmine' node_modules/angular2/src/testing/testing_internal.d.ts(39,47): error TS2503: Cannot find namespace 'jasmine'

which I assume is the origin of about 1000 errors such as

error TS2339: Property 'toHaveBeenCalled' does not exist on type 'NgMatchers'. error TS2339: Property 'toBeFalsy' does not exist on type 'NgMatchers'.

Am I missing anything on karma.conf?
Thanks you so much!

Information

Operating System OSX
Node version 5.2
NPM Version 3.5.3
Environment Browser/Mobile/WebWorker

old node support

Issue Overview

Not able to run this due to dependency

Issue Description

The package es6-shim does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer [email protected] wants es6-shim@^0.33.3

Reproducables

<Please explain the way to reproduce your issue, or even better with Plunker link>

Information

Operating System Windows/OSX/Ubuntu/orYourOSHere
Node version 4.x/5.x/orYourNodeVersionHere
NPM Version 2.x/3.x/orYourNPMVersionHere
Environment Browser/Mobile/WebWorker

Unhandled 'error' on e2e command

[19:59:25] Starting 'e2e-test'...
[19:59:25] Finished 'e2e-test' after 2.85 ms
[19:59:25] Starting 'e2e'...
[19:59:26] Finished 'e2e' after 6.16 µs
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
[launcher] Process exited with error code 1
events.js:154
throw er; // Unhandled 'error' event
^

Error: spawn java ENOENT
at exports._errnoException (util.js:856:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:475:9)
at process._tickCallback (node.js:389:17)
Error running E2E testing

Running:

Node: v5.6.0
npm: 3.4.1

Support for "Component Relative Path"

## Issue Overview

Requesting support for Component Relative Path

Issue Description

We were trying to utilize this starter and add support for https://angular.io/docs/ts/latest/cookbook/component-relative-paths.html .

However, when we build for production using "@ngstarter/systemjs-extension", html templates were not getting downloaded. All xhr request for html templates were pointing to root.

We must be missing something, hence requesting support for "Component Relative Path"

Reproducables

Just use the starter and change "absolute url" in component to relative url. Build for production and serve.

Information

Operating System Windows 10
Node version 5.x
NPM Version 3.8.x
Environment Browser

E2E-testing and socket.io-client

Hello! There was another problem. When I connect socket.io-client application in Angular2 e2e-tests do not work: the browser is started and the hanging for 30 seconds, and then terminates. But the e2e-tests did not pass.
Unit tests are working well.

Socket.io-client I connect like this:
in System.js (map):
'socket.io-client': 'n:socket.io-client'
packages:
'socket.io-client': { defaultExtension: 'js', main: 'socket.io.js', format: 'cjs' }

In services:
import * as io from 'socket.io-client';

and use like this:
io.connect(...)

I starting gulp. Then gulp e2e.
What should be done to e2e tests have started?

node production mode

<Have you checked issues section which may have your similar issue?>

Issue Overview

If You are running npm install --production
You don`t have all needed node module to make production build on linux agent.

If You make only npm install. You are installing all packages not needed for production. Like:
browser-sync
connect-history-api-fallback

Issue Description

gulp.config strongly banded to gulp.config.js

  • var historyApiFallback = require('connect-history-api-fallback');

And no production logic is separated. If You are following best practice installing only node mode that are required for each environment.

Reproducables

npm install --production
gulp build --exclude-source

Information

Operating System Debian
Node version 4.x/5.x/orYourNodeVersionHere
Environment Browser/Mobile/WebWorker

Upgrade Angular Dependencies to RC.5

Issue Overview

Angular 2.0.0-rc.5 is out with some breaking changes

Issue Description

Dependencies in this app point to rc.4. I can start the refactor and submit a PR if you would like.

Reproducables

n/a

Information

key val
Operating System OSX
Node version 4
NPM Version 3.5.3
Environment Browser

second level path routing fails

Issue Overview

second level routing (like second/home) fails with following error

http://localhost:3000/second/tmp/app/bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)

Issue Description

when I add a second level routing like following

export const HomeRoutes: RouterConfig = [
  { path: '',  component: HomeComponent },
  { path: 'second',  component: HomeComponent },
  { path: 'second/home',  component: HomeComponent }
];

and open second/home then fails with following error. (first level /second is okay)

http://localhost:3000/second/tmp/app/bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)

Reproducables

I think it is produced only in local development env.
checked occurring with gulp and gulp serve-build.

Information

Operating System Windows
Node version 4.4.5
NPM Version 2.15.5
Environment Chrome

The bundled result of `gulp build` is not running of Safari.

Hi Antony,

Issue Overview

The bundled result of gulp build is not running of Safari.
Gulp build bundle.js generates an error on Safari

Reproducables

Steps to reproduce:

  • Use a fresh install of the starter
  • run gulp build
  • load build/index.html (via server or any other way) with Safari
  • view Error:
    TypeError: Attempting to configurable attribute of unconfigurable property. and
    ReferenceError: Can't find variable: System
  • As a result the app is not loading.

I believe it is related to es-shim, but I am not sure.

Information

Operating System OSX
Node version 5.2
NPM Version 3.5.3
Environment Safari

We are building a large size app using your great starter and this is crucial for us!!!
Thank you so much
Tomer

Build file size

Hi again Antony,

Issue Overview

In my project, gulp build creates two files, bundle.js and boot.js with file sizes 1.1MB and 1.6MB respectively.
It seems very big. granted, I have a decent size project, but nothing close to 2.7 MB of javascript.

Is there a way to make the files smaller?
Are things included only once?
Does it bundle my spec.ts files?

Thanks,
Tomer

Compiling files to dist or build directory

Having *.js and *.js.map files just next to *.ts sources is painful in navigating through the files during development. It would be great to keep compiled files in a different directory.

For example this kind of solution was applied for coffee script sources in Angular1 Gulp Generator and it worked great. Please let us know if you agree with such solution. Eventually some pull request could be submitted.

I believe the motivation behind this issue is the same as in #22.

TsLint in gulp process

Thank you for this repo, it is great!

I would like to have tslint run on every ts change and log it to the console warning after every save. right now if I add 'ts-lint' to serve it errors out and will not run the server.
Could you help with that please?
Thank you!

Test succeed but the report is not generated

PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 1 of 1 SUCCESS (0 secs / 0.567 secs)
PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 1 of 1 SUCCESS (1.136 secs / 0.567 s
ERROR: 'EXCEPTION: Error in :0:0'
PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 1 of 1 SUCCESS (1.136 secs / 0.567 s
ERROR: 'STACKTRACE:'
PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 1 of 1 SUCCESS (1.136 secs / 0.567 s
ecs)
Test Done with exit code: 0
Remapping coverage to TypeScript format...
[11:46:55] Finished 'unit-test' after 7.37 s
[11:46:55] Starting 'test'...
[11:46:55] Finished 'test' after 15 µs
Remapping done! View the result in report/remap/html-report
09 06 2016 11:47:05.379:WARN [PhantomJS 2.1.1 (Windows 7 0.0.0)]: Disconnected (
PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 1 of 1 DISCONNECTED (11.144 secs / 0
.567 secs)
Test Done with exit code: 1
Remapping coverage to TypeScript format...
[11:47:05] 'unit-test' errored after 17 s
[11:47:05] Error: Unit test failed.
at formatError (C:\Users\pgarge\AppData\Roaming\npm\node_modules\gulp\bin\gu
lp.js:169:10)

at Gulp. (C:\Users\pgarge\AppData\Roaming\npm\node_modules\gulp\b
in\gulp.js:195:15)
at emitOne (events.js:96:13)
at Gulp.emit (events.js:188:7)
at Gulp.Orchestrator._emitTaskDone (C:\acex\16.09\AppLib\CE.InsightsWeb\node
_modules\orchestrator\index.js:264:8)
at C:\acex\16.09\AppLib\CE.InsightsWeb\node_modules\orchestrator\index.js:27
5:23
at finish (C:\acex\16.09\AppLib\CE.InsightsWeb\node_modules\orchestrator\lib
\runTask.js:21:8)
at cb (C:\acex\16.09\AppLib\CE.InsightsWeb\node_modules\orchestrator\lib\run
Task.js:29:3)
at karmaDone (C:\acex\16.09\AppLib\CE.InsightsWeb\tasks\test.js:23:13)
at removeAllListeners (C:\acex\16.09\AppLib\CE.InsightsWeb\node_modules\karm
a\lib\server.js:336:7)
at C:\acex\16.09\AppLib\CE.InsightsWeb\node_modules\karma\lib\server.js:347:
9
at Server. (net.js:1503:9)
at Server.g (events.js:286:16)
at emitNone (events.js:86:13)
at Server.emit (events.js:185:7)
at emitCloseNT (net.js:1549:8)
at _combinedTickCallback (internal/process/next_tick.js:71:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Remapping done! View the result in report/remap/html-report

Any help will be appreciated.

Router

I have noticed that the back button does not works properly. If i navigate :

  1. Home
  2. Simple Bind
  3. Todolist

I can go back (using the back button) to Simple Bind but not to Home.

ES6 Shim breaks build. Safari is not working without it

Issue Overview

My project is not working on safari. It complains about the Router.
When I include es6-shim <script src="node_modules/es6-shim/es6-shim.js"></script> in index.html as recommended by angular (https://angular.io/docs/ts/latest/quickstart.html), and run gulp everything works fine on all browsers

When I run gulp build, everything breaks, and I get errors also on chrome.

Issue Description

Errors on safari without es6-shim:
[Error] EXCEPTION: Error during instantiation of Router! (RouterOutlet -> Router).
[Error] ORIGINAL EXCEPTION: TypeError: undefined is not a function (evaluating 'route.startsWith("/")')

...

Errors on Chrome when es6-shim is included:

Uncaught TypeError: Cannot read property 'apply' of undefinedIr @ bundle.js:2(anonymous function) @ bundle.js:2(anonymous function) @ bundle.js:1(anonymous function) @ bundle.js:2(anonymous function) @ bundle.js:1(anonymous function) @ bundle.js:1
(index):19 Uncaught ReferenceError: System is not defined

<Please explain the way to reproduce your issue, or even better with Plunker link>

Information

Operating System OSX
Node version 5.2.0
NPM Version 3.5.3
Environment Browser

THANK YOU!

karma.conf.js issues

Hi,
Thanks again for the starter, I have few more questions please.

  1. in Karma.conf.js under "files" should the node_modules files be watched? are they expected to change?
  2. I am trying to the auto watch for Karma so it runs the tests after every save. I was able to achieve that easily, but he typescript is not being re-converted. I have tried using different preprocessors, but they also run only once.

Thank you so much!

Inlining Component's HTML and CSS

Hello,

I was looking for a way to integrate inlining of HTML and CSS resouces into a component declaration. So that code like this:

@Component({
    selector: 'navbar',
    templateUrl: 'app/navbar/navbar.html',
    styleUrls: [
        'app/navbar/navbar.css'
    ]
    directives: [RouterLink, CORE_DIRECTIVES]
})

will become something like this:

@Component({
    selector: 'navbar',
    template: `<inline HTML here>`,
    styles: [
        `inline-css-here {}`
    ]
    directives: [RouterLink, CORE_DIRECTIVES]
})

Ideally without breaking typescript sourcemaps and in a perfect world so that CSS sourcemaps are imported as well. Any ideas?

IE11

<Have you checked issues section which may have your similar issue?> Yes

Issue Overview

IE 11 Rendering

Issue Description

Can someone help me understand how to make this run on IE11? I tried adding ES6-Shim and shims-for-IE but it doesn't seem to work.

Thanks in advance.

Reproducables

Run the app on IE11.

Information

Operating System Windows/OSX/Ubuntu/orYourOSHere
Node version 4.x/5.x/orYourNodeVersionHere
NPM Version 2.x/3.x/orYourNPMVersionHere
Environment Browser/Mobile/WebWorker

Using bootstrap-sass

Hello,

Thank you for your awesome starter.

I wanted to use sass version of Bootstrap and Bootswatch because I wanted to customize like $font-size-base.

I have tested changing bootswatch-dist into bootswatch and bootstrap-sass.
I am happy with that now.

You build an awesome starter with Sass and Bootswatch, but Bootstrap could not be customized.
Do you think is it a good idea to replace bootswatch-dist like that?

Cheers!

Kenny

EADDRINUSE 3001

Issue Overview

gulp serve-build fails with Error: listen EADDRINUSE :::3001.

Issue Description

ports looks conflict with browserSync.

Reproducables

always. 4045662 chore(package.json): update karma stable (#110)

Information

Operating System Windows 10
Node version 4.4.5
NPM Version 2.15.5
Environment Chrome

Cannot find module lodash after installing

I'm new to angular 2 and i'm getting this error, after run gulp serve-dev

Issue Overview

app/todolist/completed-filter.pipe.ts(3,15): error TS2307: Cannot find module 'lodash'

i tried npm install lodash. but doesnt seem to work.

Set new Global ENV

Global.env param

Hello! How can I add an additional parameter to global.env ?
There are four modes of operation: dev (local), testing, productrion, and demo.
How can I add a "demo"?
I run: gulp build --env=demo
But it does not work.

PS I want in file main.ts present variable "declare var ENV: string" // demo

Clean clone fails to start

Issue Overview

Cloned -> npm install -> gulp serve-dev ->get error

Issue Description

Cloned the project. Did npm install + npm install gulp-util (because you get gulp-util errros).
Then I run gulp serve-dev and see that 'tsc-app' task fails with error:
<...>/project/typings/globals/core-js/index.d.ts(3,14): error TS2300: Duplicate identifier 'PropertyKey'.

Reproducables

Just do steps described in README.md

Information

Operating System Windows 7
Node version 4.4.7/6.x (tried both)
NPM Version 3.10.5
Environment NA

On spec files changes unit test are not running/reloading

Continues code developing process is not effective. On spec changes need to stop server and start over. No feat back from unit test on refactoring/changing code.

Issue Overview

On code/template changes or spec changes unit test are not "reloader"

Issue Description

On spec.js changes unit test are not reloading. On .html changes unit test are not reloading. On code .ts changes unit test are not reloading. ## Reproducables

gulp

Information

Operating System Windows/OSX/Ubuntu/orYourOSHere
Node version 4.x/5.x/orYourNodeVersionHere
NPM Version 2.x/3.x/orYourNPMVersionHere
Environment Browser/Mobile/WebWorker

Can't run tests - property "toBeDefined" is missing

Hi,
I am trying to use your starter kit and I have encountered problem with tests. Normal build gulp serve-dev is running just fine, but gulp test gives me this error - app\app.component.spec.ts(42,34): error TS2339: Property 'toBeDefined' does not exist on type 'NgMatchers'.

Any idea how to solve this? I have tried to manually install jasmine typings, but it doesn't solve the issue :-(

Cannot find module 'lodash'

<Have you checked issues section which may have your similar issue?>

Issue Overview

gulp couldn't find lodash module while running gulp.

Issue Description

gulp couldn't find loads module while running gulp. getting the below error while running gulp:

app/todolist/completed-filter.pipe.ts(3,15): error TS2307: Cannot find module 'loads'.

lodash seems installed and in the node_modules directory.

i tried deleting node_modules directory a couple of times including npm cache clean - but all to naught.

Reproducibles

Follow the install/build instruction in the README

Information

Operating System OSX 10.11.4
Node version 5.10.1
NPM Version 3.8.3
Environment N/A

Support for barrels?

Issue Overview

Weird issue when trying to use barrels.

Issue Description

I've forked your starter and updated the styles to use my LESS files. Site comes up fine.

Now I've replaced the navbar component with my own header component, and I've moved the logger into a shared folder with a few of my own common components. In both of those cases, I've used an index.ts file to create a barrel (I'm trying to follow the style guide.

The site recompiles with no errors, but I'm getting a pair of 404s now in the browser:

  • /tmp/app/header.js
  • /tmp/app/shared.js

I can't figure out why or where these urls are being generated -- too much typescript magic for me since I'm new to .ts. Is there a missing configuration to support using barrels?

Information

Operating System Arch Linux 4.5.2
Node version 6.2.0
NPM Version 3.9.2
Environment Browser

gulp-inject syntax error!

<Have you checked issues section which may have your similar issue?>

Issue Overview

<Please explain the issue overview here, short but concise and to-the-point>
gulp is not running! Error in gulp-inject package.

Issue Description

I tried to run the project, and got this error
\angular2-starter\node_modules\gulp-inject\src\inject\index.js:127`
      startTag,
              ^
SyntaxError: Unexpected token ,
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (\angular2-starter\node_modules\gulp-inject\index.js:4:28)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

\simple_ng2_app_test\angular2-starter>

Information

Operating System Windows 7
Node version 0.12.3
NPM Version 3.7.1
Environment Browser
gulp-inject 4.0.0

Template URL not found

Hi, I am using your example in our project structure and I am getting this error in tests that have TestComponentBuilder.

18 05 2016 10:30:30.601:WARN [web-server]: 404: /App/Loader/loader.html
PhantomJS 2.1.1 (Windows 7 0.0.0) LoadComponent should have been created success
fully FAILED
Failed: Uncaught (in promise): Failed to load App/Loader/loader.html
invoke@C:/acex/16.06/AppLib/CE.InsightsWeb/node_modules/zone.js/dist/zon
e.js:323:34
run@C:/acex/16.06/AppLib/CE.InsightsWeb/node_modules/zone.js/dist/zone.j
s:216:50
C:/acex/16.06/AppLib/CE.InsightsWeb/node_modules/zone.js/dist/zone.js:57
1:61
invokeTask@C:/acex/16.06/AppLib/CE.InsightsWeb/node_modules/zone.js/dist
/zone.js:356:43
runTask@C:/acex/16.06/AppLib/CE.InsightsWeb/node_modules/zone.js/dist/zo
ne.js:256:58
drainMicroTaskQueue@C:/acex/16.06/AppLib/CE.InsightsWeb/node_modules/zon
e.js/dist/zone.js:474:43
invoke@C:/acex/16.06/AppLib/CE.InsightsWeb/node_modules/zone.js/dist/zon

Here is the spec file:

`import {
it,
inject,
async,
describe,
expect
} from '@angular/core/testing';
import {
TestComponentBuilder,
ComponentFixture
} from '@angular/compiler/testing';
import { Component } from '@angular/core';
import { Loader } from '../Loader/loader';

@component({
selector: 'as-test',
template: '',
directives: [Loader]
})
class TestComponent {
}

let testFixture: ComponentFixture;
let todoCompiled;
let todoloadCmp: Loader;

describe('LoadComponent', () => {
it('should have been created successfully', async(inject([TestComponentBuilder],
(tcb: TestComponentBuilder) => {
tcb.createAsync(TestComponent).then((fixture) => {
testFixture = fixture;
fixture.detectChanges();

            todoCompiled = fixture.nativeElement;
            todoloadCmp = fixture.debugElement
                .children[0].componentInstance;
            expect(todoCompiled).toBeDefined();
        });
    })));

//it('should add todo successfully', () => {
//    //todolistCmp.todo = new Todo('test', true);
//    //todolistCmp.addTodo();
//    testFixture.detectChanges();

//    let items = todoCompiled.querySelectorAll('.acl-loader');
//    expect(items.length).toEqual(1);

//    //let item = items[items.length - 1];
//    //expect(item.querySelector('label').textContent).toEqual(' test');
//    //expect(item.querySelector('input[type="checkbox"]').checked).toBeTruthy();
//});

//it('should delete todo successfully', () => {
//    todolistCmp.delTodo(0);
//    testFixture.detectChanges();
//    expect(todoCompiled.querySelectorAll('.list-group-item').length)
//        .toEqual(2);
//});

});
`

Loader component:
`import {Component, OnInit, OnDestroy} from '@angular/core';

@component({
selector: 'Loader',
templateUrl: 'App/Loader/loader.html'
})

export class Loader implements OnInit, OnDestroy {
ngOnInit() {
//console.log('onInit');
}
ngOnDestroy() {
//console.log('onDestroy');
}
}`

All these files are in the same folder:

structure

Test runner works fine for service tests. Any help in this will be appreciated. Thanks!!

best practice in defining global deps

<Have you checked issues section which may have your similar issue?>

Issue Overview

I am trying to add Tether (required by Bootstrap 4) - but is not getting picked up in the build.

Issue Description

I am trying to add Tether (required by Bootstrap 4) - but is not getting picked up in the build. This is probably a SystemJS question, but wondering if the starter app has this covered.

Reproducables

<Please explain the way to reproduce your issue, or even better with Plunker link>

Information

Operating System N/A
Node version N/A
NPM Version N/A
Environment N/A

PhantomJS support

Hi again,

I am trying to use phantomJS as a browser option.
I have installed karma-phantomjs-launcher and added phantomJS to the list of browsers.
I am getting this error:

 Error: 'undefined' is not a constructor (evaluating 'new exports.Map()')
    Error loading http://localhost:9876/angular2/src/platform/browser/browser_adapter
      at //node_modules/systemjs/dist/system.src.js:741
      at M (/node_modules/systemjs/dist/system-polyfills.js:4)
      at H (/node_modules/systemjs/dist/system-polyfills.js:4)
      at /node_modules/systemjs/dist/system-polyfills.js:4
      at /node_modules/systemjs/dist/system-polyfills.js:4
      at /node_modules/systemjs/dist/system-polyfills.js:4
      at /node_modules/systemjs/dist/system-polyfills.js:4
      at /node_modules/angular2/bundles/angular2-polyfills.js:493
      at /node_modules/angular2/bundles/angular2-polyfills.js:118
      at run (/node_modules/angular2/bundles/angular2-polyfills.js:138)
      at zoneBoundFn (/node_modules/angular2/bundles/angular2-polyfills.js:111)

any idea what is going on?
Thank you

including google fonts in fonts.scss

Issue Overview

including url in sass is not working in serve-build

Issue Description

serve-dev works
serve-dev

but serve-build, the font is not loaded
serve-build

Reproducables

add following into src/assets/styles/fonts.scss

@import url(https://fonts.googleapis.com/css?family=Norican);

and edit main.scss like

h4 {
  color: gray;
  font-family: Norican;
}

and gulp serve-build

Information

Operating System Windows
Node version 4.4.5
NPM Version 2.15.5
Environment Chrome

Hello, @antonybudianto
I have found a walkaround for this, but wanted to share.
I googled and found an article mentioning about at-import.
sass looks adjust the sequence so @imports are at first in main.css but when it concatenated in your build, it becomes not first.

I've adjusted the sequence of css in the index.html but I think when @import is needed, it would better include direct in the index.html like following.

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Norican">

what would you think the best way to handle this case?

gulp e2e task: Error: Spec patterns did not match any files

<Have you checked issues section which may have your similar issue?>

## Issue Overview

<Please explain the issue overview here, short but concise and to-the-point>

running "gulp e2e" throws: Error: Spec patterns did not match any files

the file task/test.js appears to have the wrong path to the transpiled spec files.

line 23:
gulp.src(config.e2e + '*/.spec.js')

"gulp e2e" works if line 23 is changed to point to the files under tmp:

gulp.src(config.tmp + config.e2e + '*/.spec.js')

Issue Description

When running "gulp e2e" after launching "gulp serve-dev" the following error is thrown:
$ gulp e2e
(node:27963) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[01:32:26] Using gulpfile ~/Documents/repos/angular2-starter/gulpfile.js
[01:32:26] Starting 'driver-update'...
[01:32:26] Starting 'clean-ts-test'...
[01:32:26] Finished 'clean-ts-test' after 17 ms
[01:32:26] Starting 'tsc-e2e'...
selenium standalone is up to date.
chromedriver is up to date.
[01:32:26] Finished 'driver-update' after 228 ms
[01:32:28] Finished 'tsc-e2e' after 1.72 s
[01:32:28] Starting 'e2e-test'...
[01:32:28] Finished 'e2e-test' after 1.83 ms
[01:32:28] Starting 'e2e'...
[01:32:28] Finished 'e2e' after 1.95 μs
[launcher] Process exited with error code 1
/Users/foo/Documents/repos/angular2-starter/node_modules/q/q.js:155
throw e;
^

Error: Spec patterns did not match any files.
at Runner.run (/Users/foo/Documents/repos/angular2-starter/node_modules/protractor/built/runner.js:286:11)
at TaskRunner.run (/Users/foo/Documents/repos/angular2-starter/node_modules/protractor/built/taskRunner.js:109:27)
at createNextTaskRunner (/Users/foo/Documents/repos/angular2-starter/node_modules/protractor/built/launcher.js:216:20)
at /Users/foo/Documents/repos/angular2-starter/node_modules/protractor/built/launcher.js:239:7
at _fulfilled (/Users/foo/Documents/repos/angular2-starter/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/Users/foo/Documents/repos/angular2-starter/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/Users/foo/Documents/repos/angular2-starter/node_modules/q/q.js:796:13)
at /Users/foo/Documents/repos/angular2-starter/node_modules/q/q.js:604:Error running E2E testing

Reproducables

<Please explain the way to reproduce your issue, or even better with Plunker link>

clone repo, run "gulp serve-dev", then in another terminal "gulp e2e"

Information

Operating System OSX
Node version 6.1.0
NPM Version 3.8.9
Environment Browser

ENOENT SystemJS

Issue Overview

System JS Builder Issue - ENOENT error

Issue Description

I have used this starter together with featherjs, but I cannot get the System.js builder to work. It always throws an ENOENT error. For some reason it doesn't find the main file and throws an error. When I add the .js to it, it throws the next error cannot find app.component.

I've hit a wall. Could somebody maybe help me find the error.

Reproducables

Repo
The app code is hosted in the client folder and the build code is hosted in public. Everything else stays the same.

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.