https://angular.io/docs/js/latest/api/annotations/Directive-class.html 早期に採用。
selector
必須なため採用。
angular.module('app', ['ngNewRouter']); | |
function RootController() { | |
// noop | |
} | |
RootController.$routeConfig = [ | |
{ | |
path: '/', | |
redirectTo: '/home' | |
}, { |
https://angular.io/docs/js/latest/api/annotations/Directive-class.html 早期に採用。
selector
必須なため採用。
declare module "angular2/angular2" { | |
export function Directive(arg: any); | |
export function Component(arg: any); | |
export function View(arg: any); | |
export function bootstrap(...args: any[]); | |
export function bind(...args: any[]): any; | |
export function onChange(...args: any[]): any; | |
export class PropertyUpdate{} | |
export class NgFor{} | |
export class Pipe{} |
@Component({ | |
selector: 'organizer', | |
properties: { | |
organizer: 'organizer' // Keyは変数名this.organizer, Value は属性名(bindToControllerと一緒、=@&とかはない) | |
} | |
}) | |
@View({ | |
directives: [Row, Col, NgFor], | |
templateUrl: './app/components/organizer.html' | |
}) |
declare module 'string' { | |
export default stringjs; | |
} | |
declare function stringjs(str: string): stringjs.Instance | |
declare namespace stringjs { | |
export class Instance { | |
s: string; | |
dasherize(): Instance; | |
} |
declare module 'bemmer' { | |
export default bemmer; | |
} | |
declare namespace bemmer { | |
export function create<T>(...classNames: Array<string>): Builder<T>; | |
export interface Builder<T> { | |
(): string; | |
(elements: string): string; |
/** | |
* cw-log | |
* | |
* @copyright © 2015 OKUNOKENTARO | |
* @since cw-log v 0.1.0 (Mar 5, 2015) | |
*/ | |
declare module 'cw-log' { | |
export default cw; | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<base href="/"> | |
<title>ng-kyoto is very cool</title> | |
</head> | |
<body> | |
<my-app></my-app> | |
<script src="./bundle.js"></script> |