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
if (process.env.NODE_ENV === 'production') { | |
//we are in production | |
module.exports = require('./prod'); | |
} else { | |
module.exports = require('./dev'); | |
} |
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
const passport = require("passport"); | |
module.exports = app => { | |
app.get( | |
"/auth/google", | |
//passport gets GoogleStategy as strategy when we specify `google` string | |
passport.authenticate("google", { | |
scope: ["profile", "email"] //scope specifies to google what access we want to have inside user's profile. Google has lists of scopes to be used in this array | |
}) | |
); |
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 { EventHandlerService } from './../../services/event-handler.service'; | |
import { GlobalVariableStore } from './../../global'; | |
import { Component, OnInit, Input, HostListener, EventEmitter, Directive, ElementRef, Inject } from '@angular/core'; | |
import { TodoService } from '../../services/todo.service'; | |
import { Todo } from '../../models/Todo'; | |
import { | |
trigger, | |
state, | |
style, | |
animate, |
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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import { createStore, applyMiddleware } from 'redux'; | |
import { BrowserRouter, Route, Switch } from "react-router-dom"; | |
import promise from 'redux-promise'; | |
import PostsIndex from './components/posts_index'; | |
import PostsNew from './components/posts_new'; | |
import reducers from './reducers'; |
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 React, { Component } from "react"; | |
import { Field, reduxForm } from 'redux-form'; | |
import { Link } from 'react-router-dom'; | |
import {connect} from 'react-redux'; | |
import {createPost} from '../actions'; | |
class PostsNew extends Component { | |
renderField(field) { | |
const { meta: { touched, error } } = field; //ES6 destructuring | |
const className = `form-group ${touched && error ? 'has-danger' : ''}`; |
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 React, { Component } from "react"; | |
import { connect } from "react-redux"; | |
import { bindActionCreators } from "redux"; | |
import { fetchWeather } from "../actions/index"; //action | |
//Component becoming a container for redux | |
class SearchBar extends Component { | |
constructor(props) { | |
super(props); |
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 { HeroService } from './../../services/hero.service'; | |
import { Hero } from './../../hero'; | |
import { | |
Component, | |
Input | |
} from '@angular/core'; | |
import { | |
trigger, | |
state, | |
style, |
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 { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; | |
import { Input, Component, HostListener, ViewChild, ElementRef, OnInit, Directive, Renderer, AfterViewInit } from '@angular/core'; | |
//reusable modal. | |
//more on this reusable component: https://ng-bootstrap.github.io/#/components/modal/examples | |
@Component({ | |
selector: 'modal-quickadd-todo', | |
template: ` | |
<div class="modal-header"> |
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="row"> | |
<div class="col-lg-8 col-lg-offset-2"> | |
<h1>Start listing!</h1> | |
<form ng-submit="addTodos()"> | |
<input ng-model="myinput" type="text" name="todo" placeholder="Type your priorities" class="form-control input-lg"> | |
</form></div> | |
<div class="col-lg-8 col-lg-offset-2"> | |
<uib-tabset type="pills"> | |
<uib-tab heading="Active Tasks"> |
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
/** | |
* mainRoutes Module; | |
* | |
* Description | |
*/ | |
var app = angular.module('mainRoutes', ['ngRoute']); | |
app.config(function ($routeProvider) { | |
$routeProvider.when('/', { | |
controller: 'mainController', |