-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): update to latest dependencies, provide testing helpers, se…
…tup latest codelyzer
- Loading branch information
Showing
10 changed files
with
77 additions
and
50 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
// Transformation of the templates. This hooks is quite useful | ||
// if you're using any other templating language, for instance | ||
// jade, markdown, haml, etc. | ||
// | ||
// NOTE that this method WILL NOT throw an error in case of invalid template. | ||
// | ||
transformTemplate(code, url, decorator) { | ||
return {code: code.replace(/\$ctrl\./g, ''), url, decorator}; | ||
}, | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { getInjectableName, bundle } from 'ng-metadata/core'; | ||
import { kebabCase } from 'lodash'; | ||
|
||
interface Type extends Function { | ||
new (...args: any[]): any; | ||
} | ||
|
||
/** | ||
* helper for getting tested components | ||
* - this is just temporary and will be removed when it's part if ngMetadata | ||
*/ | ||
export function queryByDirective<T extends Function>( host: ng.IAugmentedJQuery, Type: T ) { | ||
const ctrlName = getInjectableName( Type ); | ||
const selector = kebabCase( ctrlName ); | ||
const debugElement = host.find( selector ); | ||
const componentInstance = debugElement.controller( ctrlName ) as T; | ||
|
||
return { debugElement, componentInstance }; | ||
} | ||
|
||
|
||
export function createAngular1Module(NgMetadataModule: Type) { | ||
if (typeof NgMetadataModule !== 'function') { | ||
throw new Error(` | ||
[Angular module creation Error] | ||
You have to provide ngMetadata Module class with @NgModule decorator. You provided ${NgMetadataModule} | ||
`) | ||
} | ||
return bundle(NgMetadataModule).name | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// @FIXME remove this line when https://github.com/ngParty/ng-metadata/issues/175 is resolved | ||
/// <reference path="../node_modules/ng-metadata/manual_typings/globals.d.ts" /> | ||
// we import angular type definition to support 'provide' ng-metadata function | ||
/// <reference path="../node_modules/ng-metadata/manual_typings/angular-extension.d.ts" /> | ||
|
||
// Extra variables that live on Global that will be replaced by webpack DefinePlugin | ||
declare var ENV: string; | ||
declare const ENV: string; | ||
interface GlobalEnvironment { | ||
ENV: typeof ENV | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,9 @@ | |
|
||
<body> | ||
|
||
<my-app> | ||
<np-app> | ||
Loading... | ||
</my-app> | ||
</np-app> | ||
|
||
<img src="images/pluto-the-planet.jpg"> | ||
|
||
|
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
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
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