This file contains hidden or 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 {makeExecutableSchema} from 'graphql-tools'; | |
| import {resolvers} from './resolvers'; | |
| const typeDefs = ` | |
| type Query { | |
| name: String! | |
| } | |
| ` | |
| export default makeExecutableSchema({ |
This file contains hidden or 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 express from 'express'; | |
| const app = express(); | |
| const PORT = 3000; | |
| app.get('/', (request, response) => { | |
| return response.json({ | |
| msg: 'Hello World' | |
| }) | |
| }) |
This file contains hidden or 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
| function* numbers() { | |
| let index = 1; | |
| while(true) { | |
| yield index; | |
| index = index + 1; | |
| if (index > 10) { | |
| break; | |
| } | |
| } | |
| } |
This file contains hidden or 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
| const hero = { | |
| superman: { | |
| name: 'Superman', | |
| alias: 'Clark Kent', | |
| }, | |
| batman: { | |
| name: 'Batman', | |
| alias: 'Bruce Wayne', | |
| }, | |
| flash: { |
This file contains hidden or 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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "lib": ["es6", "dom"], | |
| "outDir": "lib" | |
| }, | |
| "include": ["src"] | |
| } |
This file contains hidden or 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 { AppComponent } from './app.component'; | |
| import { TabsModule } from './tabs/tabs.module'; | |
| import { PeopleModule } from './people/people.module'; | |
| @NgModule({ | |
| declarations: [AppComponent], | |
| imports: [BrowserModule, TabsModule, PeopleModule], |
This file contains hidden or 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 {CommonModule} from '@angular/common'; | |
| import {TabsComponent} from './tabs.component'; | |
| import {TabComponent} from './tab.component'; | |
| @NgModule({ | |
| imports: [CommonModule], | |
| declarations: [TabsComponent, TabComponent], | |
| exports: [TabsComponent, TabComponent], | |
| }) |
This file contains hidden or 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 { | |
| Component, | |
| ContentChildren, | |
| QueryList, | |
| AfterContentInit, | |
| } from '@angular/core'; | |
| import {TabComponent} from './tab.component'; | |
| @Component({ | |
| selector: 'ngx-tabs', |
This file contains hidden or 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 {Component, Input} from '@angular/core'; | |
| @Component({ | |
| selector: 'ngx-tab', | |
| styles: [ | |
| ` | |
| .pane { | |
| padding: 1em; | |
| } | |
| `, |
This file contains hidden or 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 {Component} from '@angular/core'; | |
| @Component({ | |
| selector: 'app-root', | |
| template: ` | |
| <div> | |
| <h1>Reusable Angular Components</h1> | |
| </div> | |
| `, | |
| }) |
NewerOlder