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
import { Directive, HostBinding, HostListener } from '@angular/core'; | |
@Directive({ | |
selector: '[appDropdown]' | |
}) | |
export class DropdownDirective { | |
constructor() {} | |
@HostBinding('class.open') isOpen = false; |
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
import { Directive, HostListener, ElementRef, Renderer2 } from '@angular/core'; | |
@Directive({ | |
selector: '[appDropdown]' | |
}) | |
export class DropdownDirective { | |
constructor( | |
private elRef: ElementRef, | |
private renderer: Renderer2 |
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
import { Directive, ElementRef, HostListener } from '@angular/core'; | |
@Directive({ | |
selector: '[appDropdown]' | |
}) | |
export class DropdownDirective { | |
constructor( | |
private elRef: ElementRef | |
) { } |
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
.dropdown-btn { | |
background: #0288D1; | |
border: 1px solid #0288D1; | |
border-radius: .25em; | |
color: white; | |
cursor: pointer; | |
font-size: 1.5em; | |
outline: 0; | |
} |
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
<div class="wrapper"> | |
<button appDropdown class="dropdown-btn" type="button">Menu</button> | |
<div class="dropdown"> | |
<a href="https://medium.com/@kylerjohnson26" class="dropdown-item">Find me on Medium</a> | |
<a href="https://twitter.com/KylerJohnson26" class="dropdown-item">Find me on Twitter</a> | |
<a href="https://github.com/KylerJohnson26" class="dropdown-item">Find me on Github</a> | |
</div> |
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
@Directive({ | |
selector: '[appDropdown]' | |
}) | |
export default class Dropdown { } |
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
import { NgModule } from '@angular/core'; | |
import { Routes, RouterModule } from '@angular/router'; | |
import { ProfileComponent } from './profile/profile.component'; | |
const routes: Routes = [ | |
{ path: '', component: ProfileComponent } | |
]; | |
@NgModule({ | |
imports: [RouterModule.forChild(routes)], |
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
{ | |
path: 'profile', | |
loadChildren: () => import('./profile/profile.module').then(m => m.ProfileModule) | |
}, |
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
import { NgModule } from '@angular/core'; | |
import { Routes, RouterModule } from '@angular/router'; | |
import { HomeComponent } from './core/home/home.component'; | |
const routes: Routes = [ | |
{ | |
path: 'profile', | |
loadChildren: () => import('./profile/profile.module').then(m => m.ProfileModule) | |
}, | |
{ |
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
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { AppRoutingModule } from './app-routing.module'; | |
import { AppComponent } from './app.component'; | |
import { CoreModule } from './core/core.module'; | |
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | |
@NgModule({ | |
declarations: [ |
NewerOlder