-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
demo/2.0: Add getting-started component
- Loading branch information
1 parent
b0e813c
commit 23b97c8
Showing
10 changed files
with
133 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; | ||
import { GettingStartedComponent } from '@components/getting-started'; | ||
|
||
export const routes: Routes = [ | ||
{ | ||
path: '', | ||
redirectTo: 'getting-started', | ||
pathMatch: 'full', | ||
}, | ||
{ | ||
path: 'getting-started', | ||
component: GettingStartedComponent, | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes, { useHash: true, preloadingStrategy: PreloadAllModules })], | ||
exports: [RouterModule], | ||
}) | ||
export class AppRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ts/ngx-tippy-demo/src/components/getting-started/_tests/getting-started.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { GettingStartedComponent } from '../getting-started.component'; | ||
|
||
describe('GettingStartedComponent', () => { | ||
let component: GettingStartedComponent; | ||
let fixture: ComponentFixture<GettingStartedComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [GettingStartedComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(GettingStartedComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Empty file.
Empty file.
29 changes: 29 additions & 0 deletions
29
projects/ngx-tippy-demo/src/components/getting-started/getting-started.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; | ||
import { HighlightLoader } from 'ngx-highlightjs'; | ||
|
||
const themeGithub: string = 'node_modules/highlight.js/styles/github.css'; | ||
const themeAndroidStudio: string = 'node_modules/highlight.js/styles/androidstudio.css'; | ||
|
||
@Component({ | ||
selector: 'getting-started', | ||
templateUrl: './getting-started.component.html', | ||
styleUrls: ['./getting-started.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class GettingStartedComponent implements OnInit { | ||
code = `function myFunction() { | ||
document.getElementById("demo1").innerHTML = "Test 1!"; | ||
document.getElementById("demo2").innerHTML = "Test 2!"; | ||
}`; | ||
|
||
currentTheme: string = themeGithub; | ||
|
||
constructor(private hljsLoader: HighlightLoader) {} | ||
|
||
ngOnInit(): void {} | ||
|
||
changeTheme() { | ||
this.currentTheme = this.currentTheme === themeGithub ? themeAndroidStudio : themeGithub; | ||
this.hljsLoader.setTheme(this.currentTheme); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
projects/ngx-tippy-demo/src/components/getting-started/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { GettingStartedComponent } from './getting-started.component'; |
2 changes: 1 addition & 1 deletion
2
projects/ngx-tippy-demo/src/components/t-demo-content/t-demo-content.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<p>t-demo-content works!</p> | ||
<router-outlet></router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters