Skip to content

Commit

Permalink
Merge pull request #86 from juanpmarin-infocorp/master
Browse files Browse the repository at this point in the history
Update to Angular2 RC5
  • Loading branch information
rubyboy authored Aug 23, 2016
2 parents 0a18147 + 38f2cd6 commit 3abaf04
Show file tree
Hide file tree
Showing 14 changed files with 221 additions and 85 deletions.
21 changes: 21 additions & 0 deletions app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

import {Component} from "@angular/core";
import {Location} from '@angular/common';
import "../src/index";

@Component({
selector: "my-app",
styles: [`header, main, footer { padding-left: 260px; }`],
template: `
<sideNav></sideNav>
<main>
<h3>Angular2 Materialize Examples</h3>
<br/>
<router-outlet></router-outlet>
</main>
`
})
export class AppComponent { }
44 changes: 44 additions & 0 deletions app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { LocationStrategy, HashLocationStrategy } from '@angular/common';

import { AppComponent } from './app.component';
import {
Buttons,
Collapsible,
Dropdown,
Dialogs,
Tabs,
TabsRouting,
Forms,
SideNav,
DatePicker,
ModelBindings
} from './components/index';
import { routing } from './app.routing'


@NgModule({
declarations: [
AppComponent,
Buttons,
Collapsible,
Dropdown,
Dialogs,
Tabs,
TabsRouting,
Forms,
SideNav,
DatePicker,
ModelBindings
],
imports: [
BrowserModule,
routing
],
providers: [
{ provide: LocationStrategy, useClass: HashLocationStrategy },
],
bootstrap: [AppComponent]
})
export class AppModule { }
60 changes: 60 additions & 0 deletions app/app.routing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { Routes, RouterModule } from '@angular/router';
import {
Buttons,
Collapsible,
Dropdown,
Dialogs,
Tabs,
TabsRouting,
Forms,
SideNav,
DatePicker,
ModelBindings
} from './components/index';


const appRoutes: Routes = [
{
path: '',
redirectTo: 'buttons',
pathMatch: 'full'
},
{
path: 'buttons',
component: Buttons
},
{
path: 'collapsible',
component: Collapsible
},
{
path: 'dialogs',
component: Dialogs
},
{
path: 'dropdowns',
component: Dropdown
},
{
path: 'forms',
component: Forms
},
{
path: 'tabs',
component: Tabs
},
{
path: 'tabs-routing/...',
component: TabsRouting
},
{
path: 'datepicker',
component: DatePicker
},
{
path: 'modelbindings',
component: ModelBindings
}
];

export const routing = RouterModule.forRoot(appRoutes);
43 changes: 0 additions & 43 deletions app/app.ts

This file was deleted.

10 changes: 10 additions & 0 deletions app/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export { SideNav } from "./side-nav";
export { Forms } from "./forms";
export { Tabs } from "./tabs";
export { TabsRouting } from "./tabs-routing";
export { Dialogs } from "./dialogs";
export { Dropdown } from "./dropdown";
export { Collapsible } from "./collapsible";
export { Buttons } from "./buttons";
export { DatePicker } from "./datepicker";
export { ModelBindings } from "./model-bindings/model-bindings";
9 changes: 0 additions & 9 deletions app/components/side-nav.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import {MaterializeDirective} from "../../src/index";
import {Component} from "@angular/core"
import {Router, RouterLink} from "@angular/router-deprecated"
import {Location} from '@angular/common';

@Component({
selector: "sideNav",
directives: [MaterializeDirective, RouterLink],
styles: [`
nav {
height: 0px;
Expand All @@ -29,11 +27,4 @@ export class SideNav {

private routeNames = ["Buttons", "Collapsible", "Dialogs", "Dropdown", "Forms", "Tabs", "TabsRouting", "DatePicker", "ModelBindings"];

constructor(private _location:Location, private _router:Router) {
}

public isActive(routeName) {
return this._router.isRouteActive(this._router.generate([routeName]))
}

}
12 changes: 6 additions & 6 deletions app/components/tabs-routing.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {MaterializeDirective} from "../../src/index";
import {Component,OnDestroy} from "@angular/core"
import {Subscription} from "rxjs/subscription";
import {Router, RouteConfig, ROUTER_DIRECTIVES} from "@angular/router-deprecated";
import {Location} from '@angular/common';
import { Router } from '@angular/router';

@Component({selector: "tabs-test1",template: `<div id="test1" class="col s12">Test 1</div>`})
class TabsTest1 {}
Expand All @@ -15,7 +15,7 @@ class TabsTest4 {}

@Component({
selector: "tabs-routing",
directives: [ROUTER_DIRECTIVES,MaterializeDirective,TabsTest1,TabsTest2,TabsTest3,TabsTest4],
directives: [TabsTest1,TabsTest2,TabsTest3,TabsTest4],
template: `
<div class="row">
<div class="col s12">
Expand All @@ -30,12 +30,12 @@ class TabsTest4 {}
</div>
`
})
@RouteConfig([
/*@RouteConfig([
{path: "/test1", component: TabsTest1, name: "TabsTest1", useAsDefault:true},
{path: "/test2", component: TabsTest2, name: "TabsTest2"},
{path: "/test3", component: TabsTest3, name: "TabsTest3"},
{path: "/test4", component: TabsTest4, name: "TabsTest4"}
])
])*/
export class TabsRouting implements OnDestroy {

private tabs = [
Expand All @@ -48,9 +48,9 @@ export class TabsRouting implements OnDestroy {
private tabSelectionParams = null;

constructor(private router:Router, private location:Location) {
this.routerSubscription = <Subscription>router.parent.subscribe(() => {
/*this.routerSubscription = <Subscription>router.parent.subscribe(() => {
this.updateSelectionParams(router);
});
});*/
}

routeTo(route) {
Expand Down
10 changes: 3 additions & 7 deletions app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import "zone.js";
import "reflect-metadata";
import "es6-shim";

import {bootstrap} from "@angular/platform-browser-dynamic";
import {provide} from "@angular/core";
import {App} from "./app";
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';

import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
import {LocationStrategy, HashLocationStrategy} from '@angular/common';

bootstrap(App, [ROUTER_PROVIDERS, provide(LocationStrategy, {useClass: HashLocationStrategy})]);
platformBrowserDynamic().bootstrapModule(AppModule);
42 changes: 39 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ System.config({
"@angular/core": "npm:@angular/[email protected]",
"@angular/platform-browser": "npm:@angular/[email protected]",
"@angular/platform-browser-dynamic": "npm:@angular/[email protected]",
"@angular/router": "npm:@angular/[email protected]",
"@angular/router-deprecated": "npm:@angular/[email protected]",
"clean-css": "npm:[email protected]",
"crypto": "github:jspm/[email protected]",
Expand All @@ -41,7 +42,7 @@ System.config({
"reflect-metadata": "npm:[email protected]",
"rxjs": "npm:[email protected]",
"typescript": "npm:[email protected]",
"zone.js": "npm:[email protected].12",
"zone.js": "npm:[email protected].4",
"github:jspm/[email protected]": {
"assert": "npm:[email protected]"
},
Expand Down Expand Up @@ -96,14 +97,27 @@ System.config({
"@angular/core": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/core": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/core": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/core": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:@angular/[email protected]": {
"process": "github:jspm/[email protected]",
"rxjs": "npm:[email protected]",
"zone.js": "npm:[email protected]"
"zone.js": "npm:[email protected]"
},
"npm:@angular/[email protected]": {
"process": "github:jspm/[email protected]",
"rxjs": "npm:[email protected]",
"zone.js": "npm:[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/common": "npm:@angular/[email protected]",
Expand All @@ -112,17 +126,39 @@ System.config({
"@angular/platform-browser": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/common": "npm:@angular/[email protected]",
"@angular/compiler": "npm:@angular/[email protected]",
"@angular/core": "npm:@angular/[email protected]",
"@angular/platform-browser": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/common": "npm:@angular/[email protected]",
"@angular/compiler": "npm:@angular/[email protected]",
"@angular/core": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/common": "npm:@angular/[email protected]",
"@angular/compiler": "npm:@angular/[email protected]",
"@angular/core": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/common": "npm:@angular/[email protected]",
"@angular/core": "npm:@angular/[email protected]",
"@angular/platform-browser": "npm:@angular/[email protected]"
},
"npm:@angular/[email protected]": {
"@angular/common": "npm:@angular/[email protected]",
"@angular/compiler": "npm:@angular/[email protected]",
"@angular/core": "npm:@angular/[email protected]",
"@angular/platform-browser": "npm:@angular/[email protected]",
"@angular/platform-browser-dynamic": "npm:@angular/[email protected]",
"process": "github:jspm/[email protected]",
"rxjs": "npm:[email protected]"
},
"npm:[email protected]": {
"fs": "github:jspm/[email protected]",
"module": "github:jspm/[email protected]",
Expand Down Expand Up @@ -412,7 +448,7 @@ System.config({
"npm:[email protected]": {
"indexof": "npm:[email protected]"
},
"npm:[email protected].12": {
"npm:[email protected].4": {
"buffer": "github:jspm/[email protected]",
"process": "github:jspm/[email protected]"
}
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var tsc = require('gulp-typescript');
var paths = {
dist: './dist',
sourceFiles: ['./src/*'],
toDelete: ['./dist/index.ts','./dist/custom-event-polyfill.ts','./dist/materialize-directive.ts','./dist/src','./dist/app','./dist/test'],
toDelete: ['./dist/index.ts','./dist/custom-event-polyfill.ts','./dist/materialize-directive.ts','./dist/materialize-module.ts','./dist/src','./dist/app','./dist/test'],
distSourcesFiles: ['./dist/src/*']
};

Expand Down
Loading

0 comments on commit 3abaf04

Please sign in to comment.