Commit c9e12a5f authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

Initial template commit

parents
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = 0
trim_trailing_whitespace = false
# Ng2angle
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.15.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.
## Deploying to Github Pages
Run `ng github-pages:deploy` to deploy to Github Pages.
## Further help
To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
{
"project": {
"version": "1.0.0-beta.15",
"name": "ng2angle"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": "assets",
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"mobile": false,
"styles": [
"app/core/preloader/preloader.scss",
"styles.scss"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"app/core/preloader/preloader.ts",
"vendor.ts"
],
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"prefixInterfaces": false
}
}
import { Ng2anglePage } from './app.po';
describe('ng2angle App', function() {
let page: Ng2anglePage;
beforeEach(() => {
page = new Ng2anglePage();
});
it('should display Angle in h1 tag', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Angle');
});
});
import { browser, element, by } from 'protractor/globals';
export class Ng2anglePage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
{
"compileOnSave": false,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../dist/out-tsc-e2e",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: './',
frameworks: ['jasmine', 'angular-cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-remap-istanbul'),
require('angular-cli/plugins/karma')
],
files: [
{ pattern: './src/test.ts', watched: false },
{ pattern: 'src/assets/**/*', watched: false, included: false, served: true },
],
proxies: {
'/assets/': '/base/src/assets/'
},
preprocessors: {
'./src/test.ts': ['angular-cli']
},
remapIstanbulReporter: {
reports: {
html: 'coverage',
lcovonly: './coverage/coverage.lcov'
}
},
angularCli: {
config: './angular-cli.json',
environment: 'dev'
},
reporters: ['progress', 'karma-remap-istanbul'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
captureTimeout: 60000, // it was already there
browserDisconnectTimeout : 60000,
browserDisconnectTolerance : 1,
browserNoActivityTimeout : 60000 //by default 10000
});
};
{
"classPrefix": "",
"options": [
"setClasses"
],
"feature-detects": [
"css/backgroundposition-shorthand",
"css/backgroundposition-xy",
"css/backgroundrepeat",
"css/backgroundsizecover",
"css/borderradius",
"css/animations",
"css/calc",
"css/transforms",
"css/transforms3d",
"css/transformstylepreserve3d",
"css/transitions",
"css/flexboxtweener",
"css/fontface",
"svg",
"svg/asimg",
"svg/clippaths",
"svg/filters",
"svg/foreignobject",
"svg/inline",
"svg/smil",
"storage/localstorage",
"storage/sessionstorage",
"storage/websqldatabase",
"css/multiplebgs"
]
}
\ No newline at end of file
{
"name": "ng2angle",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor",
"modernizr": "modernizr -c modernizr-config.json -d src/modernizr.js"
},
"private": true,
"dependencies": {
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/core": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0",
"@angular/router": "3.0.0",
"angular2-toaster": "^1.0.1",
"bootstrap": "^4.0.0-alpha.4",
"core-js": "^2.4.1",
"font-awesome": "^4.6.3",
"jquery": "^3.1.1",
"jquery.browser": "^0.1.0",
"modernizr": "^3.3.1",
"moment": "^2.15.1",
"ng2-bootstrap": "^1.1.8",
"ng2-translate": "^3.1.0",
"node-sass": "^3.10.0",
"rxjs": "5.0.0-beta.12",
"screenfull": "^3.0.2",
"simple-line-icons": "^2.4.1",
"spinkit": "^1.2.5",
"ts-helpers": "^1.1.1",
"weather-icons": "github:erikflowers/weather-icons",
"whirl": "github:jh3y/whirl",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@types/jasmine": "^2.2.30",
"angular-cli": "1.0.0-beta.15",
"codelyzer": "~0.0.26",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-read-json": "^1.1.0",
"karma-remap-istanbul": "^0.2.1",
"loaders.css": "^0.1.2",
"protractor": "4.0.5",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "2.0.2"
}
}
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
useAllAngular2AppRoots: true,
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
}
};
<app-layout class="wrapper"></app-layout>
//== Bootstrap
@import "./shared/styles/bootstrap.scss";
//== Application
@import "./shared/styles/app.scss";
/* tslint:disable:no-unused-variable */
import { TestBed, async} from '@angular/core/testing';
import { AppComponent } from './app.component';
import { CoreModule } from './core/core.module';
import { LayoutModule } from './layout/layout.module';
import { SharedModule } from './shared/shared.module';
import { RoutesModule } from './routes/routes.module';
import { APP_BASE_HREF } from '@angular/common';
describe('App: Ng2angle', () => {
beforeEach(() => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
TestBed.configureTestingModule({
declarations: [
AppComponent
],
imports: [
CoreModule,
LayoutModule,
SharedModule,
RoutesModule
],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' }
]
});
});
it('should create the app', async(() => {
let fixture = TestBed.createComponent(AppComponent);
let app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});
import { Component, ViewEncapsulation, HostBinding } from '@angular/core';
import { SettingsService } from './core/settings/settings.service.ts';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class AppComponent {
@HostBinding('class.layout-fixed') get isFixed() { return this.settings.layout.isFixed; };
@HostBinding('class.aside-collapsed') get isCollapsed() { return this.settings.layout.isCollapsed; };
@HostBinding('class.layout-boxed') get isBoxed() { return this.settings.layout.isBoxed; };
@HostBinding('class.layout-fs') get useFullLayout() { return this.settings.layout.useFullLayout; };
@HostBinding('class.hidden-footer') get hiddenFooter() { return this.settings.layout.hiddenFooter; };
@HostBinding('class.layout-h') get horizontal() { return this.settings.layout.horizontal; };
@HostBinding('class.aside-float') get isFloat() { return this.settings.layout.isFloat; };
@HostBinding('class.offsidebar-open') get offsidebarOpen() { return this.settings.layout.offsidebarOpen; };
@HostBinding('class.aside-toggled') get asideToggled() { return this.settings.layout.asideToggled; };
@HostBinding('class.aside-collapsed-text') get isCollapsedText() { return this.settings.layout.isCollapsedText; };
constructor(public settings: SettingsService) { }
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { CoreModule } from './core/core.module';
import { LayoutModule } from './layout/layout.module';
import { SharedModule } from './shared/shared.module';
import { RoutesModule } from './routes/routes.module';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
CoreModule,
LayoutModule,
SharedModule,
RoutesModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
import { NgModule, Optional, SkipSelf } from '@angular/core';
import { SettingsService } from './settings/settings.service';
import { ThemesService } from './themes/themes.service';
import { TranslatorService } from './translator/translator.service';
import { MenuService } from './menu/menu.service';
import { throwIfAlreadyLoaded } from './module-import-guard';
@NgModule({
imports: [
],
providers: [
SettingsService,
ThemesService,
TranslatorService,
MenuService
],
declarations: [
],
exports: [
]
})
export class CoreModule {
constructor( @Optional() @SkipSelf() parentModule: CoreModule) {
throwIfAlreadyLoaded(parentModule, 'CoreModule');
}
}
/* tslint:disable:no-unused-variable */
import { TestBed, async, inject } from '@angular/core/testing';
import { MenuService } from './menu.service';
describe('Service: Menu', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [MenuService]
});
});
it('should ...', inject([MenuService], (service: MenuService) => {
expect(service).toBeTruthy();
}));
});
import { Injectable } from '@angular/core';
@Injectable()
export class MenuService {
menuItems: Array<any>;
constructor() {
this.menuItems = [];
}
addMenu(items: Array<{
text: string,
link: string,
icon: string,
alert?: string,
submenu?: Array<any>
}>) {
items.forEach((item) => {
this.menuItems.push(item);
});
}
getMenu() {
return this.menuItems;
}
}
// https://angular.io/styleguide#!#04-12
export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) {
if (parentModule) {
throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`);
}
}
<div class="preloader-progress">
<div class="preloader-progress-bar" [style.width]="loadCounter+'%'"></div>
</div>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment