{"action":"created","comment":{"url":"https://api.github.com/repos/angular/material2/pulls/comments/57360301","id":57360301,"diff_hunk":"@@ -0,0 +1,227 @@\n+import {\n+  forwardRef,\n+  Component,\n+  HostBinding,\n+  Input,\n+  Provider,\n+  Directive,\n+  AfterContentInit,\n+  ContentChild,\n+  ViewContainerRef, SimpleChange, ContentChildren, QueryList, OnChanges,\n+} from 'angular2/core';\n+import {CONST_EXPR, noop} from 'angular2/src/facade/lang';\n+import {MdAriaTarget, MdAria} from '../../core/utilities/aria-directives';\n+import {\n+  NG_VALUE_ACCESSOR,\n+  ControlValueAccessor\n+} from 'angular2/src/common/forms/directives/control_value_accessor';\n+import {BaseException} from 'angular2/src/facade/exceptions';\n+import {BooleanFieldValue} from '../../core/annotations/field-value';\n+import {OneOf} from '../../core/annotations/one-of';\n+import {iterateListLike} from 'angular2/src/facade/collection';\n+\n+\n+const MD_INPUT_CONTROL_VALUE_ACCESSOR = CONST_EXPR(new Provider(\n+    NG_VALUE_ACCESSOR, {\n+      useExisting: forwardRef(() => MdInput),\n+      multi: true\n+    }));\n+\n+// Invalid input type. Using one of these will throw an MdInputUnsupportedTypeException.\n+const MD_INPUT_INVALID_INPUT_TYPE = CONST_EXPR([\n+  'file',\n+  'radio',\n+  'checkbox',\n+]);\n+\n+\n+let nextUniqueId = 0;\n+\n+\n+export class MdInputPlaceholderConflictException extends BaseException {\n+  constructor() {\n+    super('Placeholder attribute and child element were both specified.');\n+  }\n+}\n+\n+export class MdInputUnsupportedTypeException extends BaseException {\n+  constructor(type: string) {\n+    super(`Input type \"${type}\" isn't supported by md-input.`);\n+  }\n+}\n+\n+export class MdInputDuplicatedHintException extends BaseException {\n+  constructor(align: string) {\n+    super(`A hint was already declared for 'align=\"${align}\"'.`)\n+  }\n+}\n+\n+\n+\n+/**\n+ * The placeholder directive. The content can declare this to implement more\n+ * complex placeholders.\n+ */\n+@Directive({\n+  selector: 'md-placeholder'\n+})\n+export class MdPlaceholder {}\n+\n+\n+/**\n+ * The hint directive, used to tag content as hint labels (going under the input).\n+ */\n+@Directive({\n+  selector: 'md-hint',\n+  host: {\n+    '[class.md-right]': 'align == \"end\"',\n+    '[class.md-hint]': 'true'\n+  }\n+})\n+export class MdHint {\n+  @Input() @OneOf(['start', 'end']) align: string;\n+}\n+\n+\n+/**\n+ * <md-input> component.\n+ */\n+@Component({\n+  selector: 'md-input',\n+  templateUrl: 'components/input/input.html',\n+  styleUrls: ['components/input/input.css'],\n+  providers: [MdAria, MD_INPUT_CONTROL_VALUE_ACCESSOR],\n+  directives: [MdAriaTarget],\n+})\n+export class MdInput implements ControlValueAccessor, AfterContentInit, OnChanges {\n+  private _focused: boolean = false;\n+  private _onTouched: () => void = noop;\n+  private _onChangeFn: (_: any) => void = noop;\n+  private _value: any = '';\n+\n+  /**\n+   * Aria related inputs.\n+   */\n+  @Input('aria-label') ariaLabel: string;\n+  @Input('aria-labelledby') ariaLabelledBy: string;\n+  @Input('aria-disabled') @BooleanFieldValue() ariaDisabled: boolean;\n+  @Input('aria-required') @BooleanFieldValue() ariaRequired: boolean;\n+  @Input('aria-invalid') @BooleanFieldValue() ariaInvalid: boolean;\n+\n+  /**\n+   * Content directives.\n+   */\n+  @ContentChild(MdPlaceholder) private _placeholderChild: MdPlaceholder;\n+  @ContentChildren(MdHint) private _hintChildren: QueryList<MdHint>;\n+\n+  /**\n+   * Readonly properties.\n+   */\n+  get focused() { return this._focused; }\n+  get empty() { return this._value == null || this._value === ''; }\n+  get characterCount(): number {\n+    return this.empty ? 0 : ('' + this._value).length;\n+  }\n+\n+  /**\n+   * Bindings.\n+   */\n+  @Input() @OneOf(['start', 'end']) align: string = 'start';\n+  @Input() @BooleanFieldValue() disabled: boolean = false;\n+  @Input() @OneOf(['primary', 'accent']) dividerColor: string = 'primary';\n+  @Input() @BooleanFieldValue() floatingPlaceholder: boolean = true;\n+  @Input() hintLabel: string = '';\n+  @Input() id: string = `md-input-${nextUniqueId++}`;\n+  @Input() maxLength: number = -1;\n+  @Input() placeholder: string;\n+  @Input() @BooleanFieldValue() required: boolean = false;\n+  @Input() type: string = 'text';\n+\n+  get value(): any { return this._value; };\n+  @Input() set value(v: any) {\n+    if (this._setValue(v)) {\n+      this._onChangeFn(v);\n+    }\n+  }\n+\n+  // This is to remove the `align` property of the `md-input` itself. Otherwise HTML5\n+  // might place it as RTL when we don't want to. We still want to use `align` as an\n+  // Input though, so we use HostBinding.\n+  @HostBinding('attr.align') private get _align(): any { return null; }","path":"src/components/input/input.ts","position":150,"original_position":150,"commit_id":"001e7165106a749e0f75e8b7914471f00f01c5f6","original_commit_id":"001e7165106a749e0f75e8b7914471f00f01c5f6","user":{"login":"hansl","id":681969,"avatar_url":"https://avatars.githubusercontent.com/u/681969?v=3","gravatar_id":"","url":"https://api.github.com/users/hansl","html_url":"https://github.com/hansl","followers_url":"https://api.github.com/users/hansl/followers","following_url":"https://api.github.com/users/hansl/following{/other_user}","gists_url":"https://api.github.com/users/hansl/gists{/gist_id}","starred_url":"https://api.github.com/users/hansl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansl/subscriptions","organizations_url":"https://api.github.com/users/hansl/orgs","repos_url":"https://api.github.com/users/hansl/repos","events_url":"https://api.github.com/users/hansl/events{/privacy}","received_events_url":"https://api.github.com/users/hansl/received_events","type":"User","site_admin":false},"body":"Yes. I need to remove it from the `<md-input>` tag.","created_at":"2016-03-24T18:00:26Z","updated_at":"2016-03-24T18:00:26Z","html_url":"https://github.com/angular/material2/pull/161#discussion_r57360301","pull_request_url":"https://api.github.com/repos/angular/material2/pulls/161","_links":{"self":{"href":"https://api.github.com/repos/angular/material2/pulls/comments/57360301"},"html":{"href":"https://github.com/angular/material2/pull/161#discussion_r57360301"},"pull_request":{"href":"https://api.github.com/repos/angular/material2/pulls/161"}}},"pull_request":{"url":"https://api.github.com/repos/angular/material2/pulls/161","id":62832782,"html_url":"https://github.com/angular/material2/pull/161","diff_url":"https://github.com/angular/material2/pull/161.diff","patch_url":"https://github.com/angular/material2/pull/161.patch","issue_url":"https://api.github.com/repos/angular/material2/issues/161","number":161,"state":"open","locked":false,"title":"component: MdInput","user":{"login":"hansl","id":681969,"avatar_url":"https://avatars.githubusercontent.com/u/681969?v=3","gravatar_id":"","url":"https://api.github.com/users/hansl","html_url":"https://github.com/hansl","followers_url":"https://api.github.com/users/hansl/followers","following_url":"https://api.github.com/users/hansl/following{/other_user}","gists_url":"https://api.github.com/users/hansl/gists{/gist_id}","starred_url":"https://api.github.com/users/hansl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansl/subscriptions","organizations_url":"https://api.github.com/users/hansl/orgs","repos_url":"https://api.github.com/users/hansl/repos","events_url":"https://api.github.com/users/hansl/events{/privacy}","received_events_url":"https://api.github.com/users/hansl/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-14T23:17:30Z","updated_at":"2016-03-24T18:00:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4be0b588272cf0862d0948f2eb8bd9e9af50d972","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/angular/material2/pulls/161/commits","review_comments_url":"https://api.github.com/repos/angular/material2/pulls/161/comments","review_comment_url":"https://api.github.com/repos/angular/material2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/material2/issues/161/comments","statuses_url":"https://api.github.com/repos/angular/material2/statuses/001e7165106a749e0f75e8b7914471f00f01c5f6","head":{"label":"hansl:md-input","ref":"md-input","sha":"001e7165106a749e0f75e8b7914471f00f01c5f6","user":{"login":"hansl","id":681969,"avatar_url":"https://avatars.githubusercontent.com/u/681969?v=3","gravatar_id":"","url":"https://api.github.com/users/hansl","html_url":"https://github.com/hansl","followers_url":"https://api.github.com/users/hansl/followers","following_url":"https://api.github.com/users/hansl/following{/other_user}","gists_url":"https://api.github.com/users/hansl/gists{/gist_id}","starred_url":"https://api.github.com/users/hansl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansl/subscriptions","organizations_url":"https://api.github.com/users/hansl/orgs","repos_url":"https://api.github.com/users/hansl/repos","events_url":"https://api.github.com/users/hansl/events{/privacy}","received_events_url":"https://api.github.com/users/hansl/received_events","type":"User","site_admin":false},"repo":{"id":49613274,"name":"material2","full_name":"hansl/material2","owner":{"login":"hansl","id":681969,"avatar_url":"https://avatars.githubusercontent.com/u/681969?v=3","gravatar_id":"","url":"https://api.github.com/users/hansl","html_url":"https://github.com/hansl","followers_url":"https://api.github.com/users/hansl/followers","following_url":"https://api.github.com/users/hansl/following{/other_user}","gists_url":"https://api.github.com/users/hansl/gists{/gist_id}","starred_url":"https://api.github.com/users/hansl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansl/subscriptions","organizations_url":"https://api.github.com/users/hansl/orgs","repos_url":"https://api.github.com/users/hansl/repos","events_url":"https://api.github.com/users/hansl/events{/privacy}","received_events_url":"https://api.github.com/users/hansl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hansl/material2","description":"Material Design components for Angular 2","fork":true,"url":"https://api.github.com/repos/hansl/material2","forks_url":"https://api.github.com/repos/hansl/material2/forks","keys_url":"https://api.github.com/repos/hansl/material2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hansl/material2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hansl/material2/teams","hooks_url":"https://api.github.com/repos/hansl/material2/hooks","issue_events_url":"https://api.github.com/repos/hansl/material2/issues/events{/number}","events_url":"https://api.github.com/repos/hansl/material2/events","assignees_url":"https://api.github.com/repos/hansl/material2/assignees{/user}","branches_url":"https://api.github.com/repos/hansl/material2/branches{/branch}","tags_url":"https://api.github.com/repos/hansl/material2/tags","blobs_url":"https://api.github.com/repos/hansl/material2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hansl/material2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hansl/material2/git/refs{/sha}","trees_url":"https://api.github.com/repos/hansl/material2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hansl/material2/statuses/{sha}","languages_url":"https://api.github.com/repos/hansl/material2/languages","stargazers_url":"https://api.github.com/repos/hansl/material2/stargazers","contributors_url":"https://api.github.com/repos/hansl/material2/contributors","subscribers_url":"https://api.github.com/repos/hansl/material2/subscribers","subscription_url":"https://api.github.com/repos/hansl/material2/subscription","commits_url":"https://api.github.com/repos/hansl/material2/commits{/sha}","git_commits_url":"https://api.github.com/repos/hansl/material2/git/commits{/sha}","comments_url":"https://api.github.com/repos/hansl/material2/comments{/number}","issue_comment_url":"https://api.github.com/repos/hansl/material2/issues/comments{/number}","contents_url":"https://api.github.com/repos/hansl/material2/contents/{+path}","compare_url":"https://api.github.com/repos/hansl/material2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hansl/material2/merges","archive_url":"https://api.github.com/repos/hansl/material2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hansl/material2/downloads","issues_url":"https://api.github.com/repos/hansl/material2/issues{/number}","pulls_url":"https://api.github.com/repos/hansl/material2/pulls{/number}","milestones_url":"https://api.github.com/repos/hansl/material2/milestones{/number}","notifications_url":"https://api.github.com/repos/hansl/material2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hansl/material2/labels{/name}","releases_url":"https://api.github.com/repos/hansl/material2/releases{/id}","deployments_url":"https://api.github.com/repos/hansl/material2/deployments","created_at":"2016-01-14T01:14:48Z","updated_at":"2016-02-01T19:14:13Z","pushed_at":"2016-03-23T21:26:07Z","git_url":"git://github.com/hansl/material2.git","ssh_url":"git@github.com:hansl/material2.git","clone_url":"https://github.com/hansl/material2.git","svn_url":"https://github.com/hansl/material2","homepage":"","size":380,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"abefaf5fa2e5f536782dfb9c3a6e605f25bf386d","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":49016322,"name":"material2","full_name":"angular/material2","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/material2","description":"Material Design components for Angular 2","fork":false,"url":"https://api.github.com/repos/angular/material2","forks_url":"https://api.github.com/repos/angular/material2/forks","keys_url":"https://api.github.com/repos/angular/material2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/material2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/material2/teams","hooks_url":"https://api.github.com/repos/angular/material2/hooks","issue_events_url":"https://api.github.com/repos/angular/material2/issues/events{/number}","events_url":"https://api.github.com/repos/angular/material2/events","assignees_url":"https://api.github.com/repos/angular/material2/assignees{/user}","branches_url":"https://api.github.com/repos/angular/material2/branches{/branch}","tags_url":"https://api.github.com/repos/angular/material2/tags","blobs_url":"https://api.github.com/repos/angular/material2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/material2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/material2/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/material2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/material2/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/material2/languages","stargazers_url":"https://api.github.com/repos/angular/material2/stargazers","contributors_url":"https://api.github.com/repos/angular/material2/contributors","subscribers_url":"https://api.github.com/repos/angular/material2/subscribers","subscription_url":"https://api.github.com/repos/angular/material2/subscription","commits_url":"https://api.github.com/repos/angular/material2/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/material2/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/material2/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/material2/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/material2/contents/{+path}","compare_url":"https://api.github.com/repos/angular/material2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/material2/merges","archive_url":"https://api.github.com/repos/angular/material2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/material2/downloads","issues_url":"https://api.github.com/repos/angular/material2/issues{/number}","pulls_url":"https://api.github.com/repos/angular/material2/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/material2/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/material2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/material2/labels{/name}","releases_url":"https://api.github.com/repos/angular/material2/releases{/id}","deployments_url":"https://api.github.com/repos/angular/material2/deployments","created_at":"2016-01-04T18:50:02Z","updated_at":"2016-03-24T17:56:43Z","pushed_at":"2016-03-24T17:07:42Z","git_url":"git://github.com/angular/material2.git","ssh_url":"git@github.com:angular/material2.git","clone_url":"https://github.com/angular/material2.git","svn_url":"https://github.com/angular/material2","homepage":"","size":507,"stargazers_count":1228,"watchers_count":1228,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":140,"mirror_url":null,"open_issues_count":52,"forks":140,"open_issues":52,"watchers":1228,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/material2/pulls/161"},"html":{"href":"https://github.com/angular/material2/pull/161"},"issue":{"href":"https://api.github.com/repos/angular/material2/issues/161"},"comments":{"href":"https://api.github.com/repos/angular/material2/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/material2/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/material2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/material2/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/angular/material2/statuses/001e7165106a749e0f75e8b7914471f00f01c5f6"}}}}