Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .babelrc.karma

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
artifacts
build
node_modules
/typings
npm-debug.log
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ before_install:

install:
- npm install gulp --global
- npm install typings --global
- npm install codecov --global

before_script:
- npm install
- typings install

script:
- gulp lint
Expand Down
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const webpack = require('./webpack-test.config');

module.exports = function(config) {
const webpack = require('./webpack-test.config')(config);

config.set({

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"sass-loader": "^4.0.2",
"sinon": "^1.17.6",
"style-loader": "^0.13.1",
"ts-loader": "^0.8.2",
"typescript": "^2.0.0",
"url-loader": "^0.5.7",
"webpack": "^1.13.2",
"webpack-combine-loaders": "^2.0.0",
Expand Down
7 changes: 0 additions & 7 deletions src/app.js

This file was deleted.

12 changes: 12 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference path="./typings/angular-loading-bar.d.ts" />
/// <reference path="./typings/angular-messages.d.ts" />
/// <reference path="./typings/angular-toastr.d.ts" />
/// <reference path="./typings/require.d.ts" />

import './style.scss';

import * as angular from 'angular';
import bootstrap from './app/bootstrap';

angular.injector(['ng'])
.invoke(bootstrap);
2 changes: 1 addition & 1 deletion src/app/about/module.js → src/app/about/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import angular from 'angular';
import * as angular from 'angular';
import states from './states/config';
import uiRouter from 'angular-ui-router';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import template from './template.html';

export default {
name: 'about',

template,
template: require('./template.html'),
url: '/about'
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as angular from 'angular';
import { expect } from 'chai';
import module from '../../module';

Expand Down
4 changes: 2 additions & 2 deletions src/app/bootstrap.js → src/app/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import angular from 'angular';
import * as angular from 'angular';
import module from './module';

export default function($document) {
export default function($document: JQuery) {
'ngInject';

angular.element($document).ready(() => {
Expand Down
12 changes: 6 additions & 6 deletions src/app/bootstrap_spec.js → src/app/bootstrap_spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import angular from 'angular';
import * as angular from 'angular';
import bootstrap from './bootstrap';
import { expect } from 'chai';
import sinon from 'sinon';
import * as sinon from 'sinon';

describe('boostrap', () => {

let sandbox;
let sandbox, stub;

beforeEach(() => {
sandbox = sinon.sandbox.create();

// Do not boot the app in the test environment
sandbox.stub(angular, 'bootstrap');
stub = sandbox.stub(angular, 'bootstrap');
});

afterEach(() => {
Expand All @@ -25,9 +25,9 @@ describe('boostrap', () => {
$injector.invoke(bootstrap);

angular.element($document).ready(() => {
expect(angular.bootstrap.called).to.be.true;
expect(stub.called).to.be.true;

const [, modules, options] = angular.bootstrap.lastCall.args;
const [, modules, options] = stub.lastCall.args;
expect(modules[0]).to.eq('app');
expect(options).to.have.property('strictDi', true);

Expand Down
5 changes: 0 additions & 5 deletions src/app/commons/components/footer/component.js

This file was deleted.

3 changes: 3 additions & 0 deletions src/app/commons/components/footer/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
template: require('./template.html')
};
5 changes: 0 additions & 5 deletions src/app/commons/components/navigation/component.js

This file was deleted.

3 changes: 3 additions & 0 deletions src/app/commons/components/navigation/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
template: require('./template.html')
};
4 changes: 2 additions & 2 deletions src/app/commons/module.js → src/app/commons/module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import angular from 'angular';
import * as angular from 'angular';
import * as toastr from 'angular-toastr';
import components from './components/config';
import services from './services/config';
import toastr from 'angular-toastr';

export default angular.module('app.commons', [
toastr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function($window) {
export default function($window: ng.IWindowService) {
'ngInject';

return function(message) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import module from '../../module';
import sinon from 'sinon';
import * as sinon from 'sinon';

describe(`module: ${module}`, () => {

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function($window) {
export default function($window: ng.IWindowService) {
'ngInject';

return function(message) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as angular from 'angular';
import { expect } from 'chai';
import module from '../../module';
import sinon from 'sinon';
import * as sinon from 'sinon';

describe(`module: ${module}`, () => {

Expand Down
4 changes: 1 addition & 3 deletions src/app/config.js → src/app/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import template404 from './404.html';

export function router($urlMatcherFactoryProvider, $urlRouterProvider) {
'ngInject';

Expand All @@ -12,7 +10,7 @@ export function notFoundState($stateProvider, $urlRouterProvider) {

$stateProvider
.state('404', {
template: template404
template: require('./404.html')
});

$urlRouterProvider.otherwise(($injector) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import controller from './controller';
import template from './template.html';

export default {
bindings: {
originalContact: '=contact',
onSubmit: '&'
},
controller: controller,
template
template: require('./template.html')
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import angular from 'angular';
import * as angular from 'angular';
import { expect } from 'chai';
import module from '../../module';
import sinon from 'sinon';
import * as sinon from 'sinon';

describe(`module: ${module}`, () => {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import angular from 'angular';
import * as angular from 'angular';

export default class {

constructor($q) {
contact: any;
originalContact: any;
onSubmit: Function;

saving: boolean;

constructor(private $q) {
'ngInject';
this.$q = $q;

this.saving = false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import controller from './controller';
import template from './template.html';

export default {
bindings: {
contact: '='
},
controller,
template
template: require('./template.html')
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import angular from 'angular';
import * as angular from 'angular';
import { expect } from 'chai';
import module from '../../module';
import sinon from 'sinon';
import * as sinon from 'sinon';

describe(`module: ${module}`, () => {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export default class {

contact: any;
saving: boolean;

$onInit() {
this.saving = false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import angular from 'angular';
import * as angular from 'angular';
import { expect } from 'chai';
import module from '../../module';
import sinon from 'sinon';
import * as sinon from 'sinon';

describe(`module: ${module}`, () => {

Expand Down
6 changes: 3 additions & 3 deletions src/app/contacts/module.js → src/app/contacts/module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import angular from 'angular';
import angularMessages from 'angular-messages';
import angularResource from 'angular-resource';
import * as angular from 'angular';
import * as angularMessages from 'angular-messages';
import * as angularResource from 'angular-resource';
import appCommons from '../commons/module';
import components from './components/config';
import services from './services/config';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import angular from 'angular';
import * as angular from 'angular';
import { extend } from '../../../utils';

export default function($resource) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
export default class {

constructor($state, toastr, contact) {
'ngInject';
contact: any;

this.$state = $state;
this.toastr = toastr;
constructor(private $state, private toastr, contact) {
'ngInject';

this.contact = contact;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import angular from 'angular';
import * as angular from 'angular';
import { expect } from 'chai';
import module from '../../module';
import sinon from 'sinon';
import * as sinon from 'sinon';
import toastrMockModule from '../../../../specs/toastr_mock_module';

describe(`module: ${module}`, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import controller from './controller';
import template from './template.html';

function contact($stateParams, Contact) {
'ngInject';
Expand All @@ -18,6 +17,6 @@ export default {
contact
},

template,
template: require('./template.html'),
url: '/:id/edit'
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export default class {

contacts: Array<any>;

constructor(contacts) {
'ngInject';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe(`module: ${module}`, () => {
}));

it('has an array of contacts', () => {
expect(ctrl.contacts).to.be.an.array;
expect(ctrl.contacts).to.be.an.instanceOf(Array);
expect(ctrl.contacts).to.have.length(2);

expect(ctrl.contacts[0]).to.have.property('id', 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import controller from './controller';
import template from './template.html';

function contacts(Contact) {
'ngInject';
Expand All @@ -16,6 +15,6 @@ export default {
contacts
},

template,
template: require('./template.html'),
url: '/'
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe(`module: ${module}`, () => {
]});

$resolve.resolve(state.resolve).then(({ contacts }) => {
expect(contacts).to.be.an.array;
expect(contacts).to.be.an.instanceOf(Array);
expect(contacts).to.have.length(2);
expect(contacts[0]).to.have.property('id', 10);
expect(contacts[1]).to.have.property('id', 11);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
export default class {

constructor($state, toastr, contact) {
'ngInject';
contact: any;

this.$state = $state;
this.toastr = toastr;
constructor(private $state, private toastr, contact) {
'ngInject';

this.contact = contact;
}
Expand Down
Loading