{"id":2035,"date":"2017-05-08T12:36:23","date_gmt":"2017-05-08T12:36:23","guid":{"rendered":"http:\/\/salientsoft.co.uk\/?p=2035"},"modified":"2018-10-10T17:15:57","modified_gmt":"2018-10-10T17:15:57","slug":"angular-2-difference-between-input-and-inputs-in-angular2-components","status":"publish","type":"post","link":"https:\/\/salientsoft.co.uk\/?p=2035","title":{"rendered":"Angular 2 -Difference between @Input and inputs in Angular2 Components?"},"content":{"rendered":"<p><a href=\"http:\/\/stackoverflow.com\/questions\/33648586\/what-is-the-difference-between-input-and-inputs-in-angular2-components\">This post<\/a> discusses the alternative way of specifying input parameters for angular 2.<\/p>\n<p>This can be done using either:-<\/p>\n<blockquote>\n<pre><code>@Component{(\n    selector: &quot;my-component&quot;,\n    inputs: [&quot;attr&quot;]\n)}\nexport class MyComponent {\n}<\/code><\/pre>\n<\/blockquote>\n<p>or alternatively:-<\/p>\n<blockquote>\n<pre><code>@Component{(\n    selector: &quot;my-component&quot;\n)}\nexport class MyComponent {\n    @Input()\n    public attr: any;\n}<\/code><\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>This post discusses the alternative way of specifying input parameters for angular 2. This can be done using either:- @Component{( selector: &quot;my-component&quot;, inputs: [&quot;attr&quot;] )} export class MyComponent { } or alternatively:- @Component{( selector: &quot;my-component&quot; )} export class MyComponent { @Input() public attr: any; }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[198],"tags":[16,15],"_links":{"self":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2035"}],"collection":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2035"}],"version-history":[{"count":2,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2035\/revisions"}],"predecessor-version":[{"id":2037,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2035\/revisions\/2037"}],"wp:attachment":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}