Skip to content

Commit

Permalink
Finally works, without errors :D
Browse files Browse the repository at this point in the history
  • Loading branch information
sorcamarian committed Aug 31, 2016
1 parent dacba6e commit ea4334c
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 13 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Angularfire2WebpackErrors

This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.11-webpack.2.

## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Deploying to Github Pages

Run `ng github-pages:deploy` to deploy to Github Pages.

## Further help

To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
2 changes: 1 addition & 1 deletion angular-cli.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"project": {
"version": "1.0.0-beta.11-webpack.2",
"name": "angularfire2-webpack-errors"
"name": "angularfire2-webpack-errors-solved"
},
"apps": [
{
Expand Down
8 changes: 4 additions & 4 deletions e2e/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Angularfire2WebpackErrorsPage } from './app.po';
import { Angularfire2Webpackerrors-solvedPage } from './app.po';

describe('angularfire2-webpack-errors App', function() {
let page: Angularfire2WebpackErrorsPage;
describe('angularfire2-webpack-errors-solved App', function() {
let page: Angularfire2Webpackerrors-solvedPage;

beforeEach(() => {
page = new Angularfire2WebpackErrorsPage();
page = new Angularfire2Webpackerrors-solvedPage();
});

it('should display message saying app works', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/app.po.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export class Angularfire2WebpackErrorsPage {
export class Angularfire2Webpackerrors-solvedPage {
navigateTo() {
return browser.get('/');
}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "angularfire2-webpack-errors",
"name": "angularfire2-webpack-errors-solved",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
Expand All @@ -20,7 +20,9 @@
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"angularfire2": "^2.0.0-beta.4",
"core-js": "^2.4.0",
"firebase": "^3.3.0",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"ts-helpers": "^1.1.1",
Expand Down
19 changes: 16 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<h1>
{{title}}
</h1>
<section *ngIf="items">
<h1>Items receiven from database</h1>
<ul>
<li class="text" *ngFor="let item of items; let i = index">
{{i}}
</li>
</ul>
</section>

<h1 *ngIf="!items">Items not yet receiven from database</h1>

<br>
<hr>
<footer>
Thanks: <a href="https://github.com/angular/angularfire2/issues/461">https://github.com/angular/angularfire2/issues/461</a>
</footer>
2 changes: 1 addition & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { addProviders, async, inject } from '@angular/core/testing';
import { AppComponent } from './app.component';

describe('App: Angularfire2WebpackErrors', () => {
describe('App: Angularfire2Webpackerrors-solved', () => {
beforeEach(() => {
addProviders([AppComponent]);
});
Expand Down
9 changes: 9 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { AngularFire, FirebaseListObservable } from 'angularfire2';

@Component({
selector: 'app-root',
Expand All @@ -7,4 +8,12 @@ import { Component } from '@angular/core';
})
export class AppComponent {
title = 'app works!';
items = null;

constructor(af: AngularFire) {
af.database.list('/').subscribe( (itemParamenter) => {
// .subscribe() because asyncronous response
this.items = itemParamenter;
});
}
}
13 changes: 12 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ import { NgModule, ApplicationRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import {AngularFireModule} from 'angularfire2';
import * as firebase from 'firebase';

const firebaseConfig = {
apiKey: "AIzaSyB8muYl0n491yZ6vMdOMfV7pr2_MGphEMo",
authDomain: "timemanager-21.firebaseapp.com",
databaseURL: "https://timemanager-21.firebaseio.com",
storageBucket: "timemanager-21.appspot.com"
}


@NgModule({
declarations: [
Expand All @@ -11,7 +21,8 @@ import { AppComponent } from './app.component';
imports: [
BrowserModule,
CommonModule,
FormsModule
FormsModule,
AngularFireModule.initializeApp(firebaseConfig)
],
providers: [],
entryComponents: [AppComponent],
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Angularfire2WebpackErrors</title>
<title>Angularfire2 Webpack errors-solved</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down

0 comments on commit ea4334c

Please sign in to comment.