Skip to content

Instantly share code, notes, and snippets.

View philipjfulcher's full-sized avatar

Philip Fulcher philipjfulcher

View GitHub Profile
@philipjfulcher
philipjfulcher / app.config.js
Created April 17, 2020 20:09
Example of importing HTML using raw-loader in AngularJS
import authInterceptor from './auth.interceptor'
import template from '../layout/app-view.html';
function AppConfig($httpProvider, $stateProvider, $locationProvider, $urlRouterProvider) {
'ngInject';
$httpProvider.interceptors.push(authInterceptor);
/*
If you don't want hashbang routing, uncomment this line.
@philipjfulcher
philipjfulcher / angular.json
Created April 17, 2020 20:07
Example build and serve commands for building AngularJS app with webpack in Nx
...
"build": {
"builder": "@nrwl/web:build",
"options": {
"outputPath": "dist/apps/realworld",
"index": "apps/realworld/src/index.html",
"main": "apps/realworld/src/main.ts",
"polyfills": "apps/realworld/src/polyfills.ts",
"tsConfig": "apps/realworld/tsconfig.app.json",
"assets": [
@philipjfulcher
philipjfulcher / webpack.config.js
Created April 17, 2020 20:05
Example webpack cnfig for building AngularJS app in Nx
const path = require('path');
module.exports = (config, context) => {
return {
...config,
module: {
strictExportPresence: true,
rules: [
{
test: /\.html$/,
@philipjfulcher
philipjfulcher / angular.json
Created April 17, 2020 20:04
Example build and serve commands for gulp in NX
...
"build": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "npx gulp --gulpfile apps/realworld/gulpfile.js build"
}
]
}
@philipjfulcher
philipjfulcher / gulpfile.js
Created April 17, 2020 20:01
Example gulpfile.js for AngularJS app in Nx
var gulp = require('gulp');
var notify = require('gulp-notify');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var babelify = require('babelify');
var ngAnnotate = require('browserify-ngannotate');
var browserSync = require('browser-sync').create();
var rename = require('gulp-rename');
var templateCache = require('gulp-angular-templatecache');
var uglify = require('gulp-uglify');
# libs/data-access/src/lib/graphql/operations.graphql
query setList {
allSets{
id
name
numParts
year
}
}
npx create-nx-workspace@latest nx-apollo-angular-example
? What to create in the new workspace angular-nest [a workspace with a
full stack application (Angular + Nest)]
? Application name nx-apollo
? Default stylesheet format CSS
# apps/api/src/app/schema.graphql
type Set {
id: Int!
name: String
year: Int
numParts: Int
}
type Query {