mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 12:35:07 +00:00
Init.
This commit is contained in:
parent
18e3c4abb8
commit
f21eaa57bb
6273
package-lock.json
generated
Normal file
6273
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -12,16 +12,18 @@
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^4.0.0",
|
"@angular/animations": "^4.2.4",
|
||||||
"@angular/common": "^4.0.0",
|
"@angular/common": "^4.0.0",
|
||||||
"@angular/compiler": "^4.0.0",
|
"@angular/compiler": "^4.0.0",
|
||||||
"@angular/core": "^4.0.0",
|
"@angular/core": "^4.0.0",
|
||||||
"@angular/forms": "^4.0.0",
|
"@angular/forms": "^4.0.0",
|
||||||
"@angular/http": "^4.0.0",
|
"@angular/http": "^4.0.0",
|
||||||
|
"@angular/material": "^2.0.0-beta.7",
|
||||||
"@angular/platform-browser": "^4.0.0",
|
"@angular/platform-browser": "^4.0.0",
|
||||||
"@angular/platform-browser-dynamic": "^4.0.0",
|
"@angular/platform-browser-dynamic": "^4.0.0",
|
||||||
"@angular/router": "^4.0.0",
|
"@angular/router": "^4.0.0",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
|
"hammerjs": "^2.0.8",
|
||||||
"rxjs": "^5.1.0",
|
"rxjs": "^5.1.0",
|
||||||
"zone.js": "^0.8.4"
|
"zone.js": "^0.8.4"
|
||||||
},
|
},
|
||||||
|
@ -40,6 +42,7 @@
|
||||||
"karma-coverage-istanbul-reporter": "^1.2.1",
|
"karma-coverage-istanbul-reporter": "^1.2.1",
|
||||||
"karma-jasmine": "~1.1.0",
|
"karma-jasmine": "~1.1.0",
|
||||||
"karma-jasmine-html-reporter": "^0.2.2",
|
"karma-jasmine-html-reporter": "^0.2.2",
|
||||||
|
"node-sass": "^4.5.3",
|
||||||
"protractor": "~5.1.2",
|
"protractor": "~5.1.2",
|
||||||
"ts-node": "~3.0.4",
|
"ts-node": "~3.0.4",
|
||||||
"tslint": "~5.3.2",
|
"tslint": "~5.3.2",
|
||||||
|
|
|
@ -1,20 +1,3 @@
|
||||||
<!--The whole content below can be removed with the new code.-->
|
<div class="example-container">
|
||||||
<div style="text-align:center">
|
<fuse-component name="Sercan"></fuse-component>
|
||||||
<h1>
|
|
||||||
Welcome to {{title}}!!
|
|
||||||
</h1>
|
|
||||||
<img width="300" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyNTAgMjUwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNTAgMjUwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDojREQwMDMxO30NCgkuc3Qxe2ZpbGw6I0MzMDAyRjt9DQoJLnN0MntmaWxsOiNGRkZGRkY7fQ0KPC9zdHlsZT4NCjxnPg0KCTxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMTI1LDMwIDEyNSwzMCAxMjUsMzAgMzEuOSw2My4yIDQ2LjEsMTg2LjMgMTI1LDIzMCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAJIi8+DQoJPHBvbHlnb24gY2xhc3M9InN0MSIgcG9pbnRzPSIxMjUsMzAgMTI1LDUyLjIgMTI1LDUyLjEgMTI1LDE1My40IDEyNSwxNTMuNCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAxMjUsMzAgCSIvPg0KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xMjUsNTIuMUw2Ni44LDE4Mi42aDBoMjEuN2gwbDExLjctMjkuMmg0OS40bDExLjcsMjkuMmgwaDIxLjdoMEwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMQ0KCQlMMTI1LDUyLjF6IE0xNDIsMTM1LjRIMTA4bDE3LTQwLjlMMTQyLDEzNS40eiIvPg0KPC9nPg0KPC9zdmc+DQo=" />
|
|
||||||
</div>
|
</div>
|
||||||
<h2>Here are some links to help you start: </h2>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<h2><a target="_blank" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<h2><a target="_blank" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<h2><a target="_blank" href="http://angularjs.blogspot.ca/">Angular blog</a></h2>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,26 @@
|
||||||
import {BrowserModule} from '@angular/platform-browser';
|
import {BrowserModule} from '@angular/platform-browser';
|
||||||
import {NgModule} from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
|
import 'hammerjs';
|
||||||
|
import {MaterialModule} from './material.module';
|
||||||
|
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||||
import {AppComponent} from './app.component';
|
import {AppComponent} from './app.component';
|
||||||
|
import {FuseDirective, FuseComponent, NameGetterComponent} from './fuse-component/fuse.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent
|
AppComponent,
|
||||||
|
FuseComponent,
|
||||||
|
FuseDirective,
|
||||||
|
NameGetterComponent
|
||||||
],
|
],
|
||||||
imports : [
|
imports : [
|
||||||
BrowserModule
|
BrowserModule,
|
||||||
|
BrowserAnimationsModule,
|
||||||
|
MaterialModule
|
||||||
],
|
],
|
||||||
providers : [],
|
providers : [],
|
||||||
bootstrap : [AppComponent]
|
bootstrap : [AppComponent]
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
41
src/app/fuse-component/fuse.component.html
Normal file
41
src/app/fuse-component/fuse.component.html
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<h3>Normal Buttons</h3>
|
||||||
|
<div class="button-row">
|
||||||
|
<button md-button>Flat button</button>
|
||||||
|
<button md-raised-button>Raised button</button>
|
||||||
|
<button md-fab>
|
||||||
|
<md-icon>check</md-icon>
|
||||||
|
</button>
|
||||||
|
<button md-mini-fab>
|
||||||
|
<md-icon>check</md-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Link Buttons</h3>
|
||||||
|
<div class="example-button-row">
|
||||||
|
<a md-button routerLink=".">Flat button</a>
|
||||||
|
<a md-raised-button routerLink=".">Raised button</a>
|
||||||
|
<a md-fab routerLink=".">
|
||||||
|
<md-icon>check</md-icon>
|
||||||
|
</a>
|
||||||
|
<a md-mini-fab routerLink=".">
|
||||||
|
<md-icon>check</md-icon>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<h1>
|
||||||
|
{{name}}
|
||||||
|
</h1>
|
||||||
|
<md-icon svgIcon="thumbs-up"></md-icon>
|
||||||
|
|
||||||
|
<md-icon class="mat-icon material-icons" role="img" aria-hidden="true">home</md-icon>
|
||||||
|
|
||||||
|
<div fuseDirective></div>
|
||||||
|
|
||||||
|
<fuse-name-getter [nameValue]="name">
|
||||||
|
|
||||||
|
</fuse-name-getter>
|
||||||
|
|
||||||
|
<input type="text" [value]="name2" (change)="name2=$event.target.value">
|
||||||
|
|
||||||
|
<button md-button (click)="name2='Sercan'">
|
||||||
|
{{name2}}
|
||||||
|
</button>
|
8
src/app/fuse-component/fuse.component.scss
Normal file
8
src/app/fuse-component/fuse.component.scss
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
:host {
|
||||||
|
background: gray;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
25
src/app/fuse-component/fuse.component.spec.ts
Normal file
25
src/app/fuse-component/fuse.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { FuseComponent } from './my-new-component.component';
|
||||||
|
|
||||||
|
describe('FuseComponent', () => {
|
||||||
|
let component: FuseComponent;
|
||||||
|
let fixture: ComponentFixture<FuseComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ FuseComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(FuseComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
62
src/app/fuse-component/fuse.component.ts
Normal file
62
src/app/fuse-component/fuse.component.ts
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
import {Component, Directive, ElementRef, Input, OnInit, Output} from '@angular/core';
|
||||||
|
|
||||||
|
@Directive({
|
||||||
|
selector: '[fuseDirective]'
|
||||||
|
})
|
||||||
|
export class FuseDirective
|
||||||
|
{
|
||||||
|
@Input('fuseDirective') fuseDirective: string;
|
||||||
|
|
||||||
|
constructor(private el: ElementRef)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'fuse-name-getter',
|
||||||
|
template: `
|
||||||
|
<h1>
|
||||||
|
{{nameValue}}
|
||||||
|
{{surname}}
|
||||||
|
</h1>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class NameGetterComponent implements OnInit
|
||||||
|
{
|
||||||
|
surname: string;
|
||||||
|
@Input('nameValue') nameValue: string;
|
||||||
|
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
this.surname = 'HELVACI';
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit()
|
||||||
|
{
|
||||||
|
this.surname = 'Yemen';
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : 'fuse-component',
|
||||||
|
templateUrl: './fuse.component.html',
|
||||||
|
styleUrls : ['./fuse.component.scss']
|
||||||
|
})
|
||||||
|
export class FuseComponent implements OnInit
|
||||||
|
{
|
||||||
|
name2: string;
|
||||||
|
@Input('name') name: string;
|
||||||
|
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit()
|
||||||
|
{
|
||||||
|
this.name2 = this.name;
|
||||||
|
console.log(this.name);
|
||||||
|
console.info('on init');
|
||||||
|
}
|
||||||
|
}
|
17
src/app/material.module.ts
Normal file
17
src/app/material.module.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import {NgModule} from '@angular/core';
|
||||||
|
import {MdButtonModule, MdCheckboxModule} from '@angular/material';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
MdButtonModule,
|
||||||
|
MdCheckboxModule
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
MdButtonModule,
|
||||||
|
MdCheckboxModule
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class MaterialModule
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<app-root></app-root>
|
<app-root></app-root>
|
||||||
|
|
|
@ -1 +1,6 @@
|
||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
|
@ -68,7 +68,7 @@
|
||||||
"object-literal-sort-keys": false,
|
"object-literal-sort-keys": false,
|
||||||
"one-line": [
|
"one-line": [
|
||||||
true,
|
true,
|
||||||
"check-open-brace",
|
//"check-open-brace",
|
||||||
"check-catch",
|
"check-catch",
|
||||||
"check-else",
|
"check-else",
|
||||||
"check-whitespace"
|
"check-whitespace"
|
||||||
|
@ -110,13 +110,13 @@
|
||||||
"directive-selector": [
|
"directive-selector": [
|
||||||
true,
|
true,
|
||||||
"attribute",
|
"attribute",
|
||||||
"app",
|
"fuse",
|
||||||
"camelCase"
|
"camelCase"
|
||||||
],
|
],
|
||||||
"component-selector": [
|
"component-selector": [
|
||||||
true,
|
true,
|
||||||
"element",
|
"element",
|
||||||
"app",
|
"fuse",
|
||||||
"kebab-case"
|
"kebab-case"
|
||||||
],
|
],
|
||||||
"use-input-property-decorator": true,
|
"use-input-property-decorator": true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user