{"id":118,"date":"2017-10-06T00:56:26","date_gmt":"2017-10-06T00:56:26","guid":{"rendered":"http:\/\/dart.honobono-life.info\/?p=118"},"modified":"2017-10-06T00:56:26","modified_gmt":"2017-10-06T00:56:26","slug":"angulardart-v4-interpolation2way-data-binding","status":"publish","type":"post","link":"http:\/\/dart.honobono-life.info\/?p=118","title":{"rendered":"AngularDart v4 Interpolation,2way data binding"},"content":{"rendered":"AngularDart v4 Sample Code,Demo<br \/>\r\n<!--more-->\r\n<ul>\r\n<li>AngularDart : 4.0.0<\/li>\r\n<li>Dart : 1.24.1<\/li>\r\n<\/ul>\r\n<div role=\"tabpanel\">\r\n  <ul class=\"nav nav-tabs\">\r\n    <li class=\"active\"><a href=\"#demo1\" data-toggle=\"tab\">demo<\/a><\/li>\r\n    <li><a href=\"#html1\" data-toggle=\"tab\">markup<\/a><\/li>\r\n    <li><a href=\"#script1\" data-toggle=\"tab\">dart<\/a><\/li>\r\n  <\/ul>\r\n  <div class=\"tab-content\">\r\n    <div class=\"tab-pane active\" id=\"demo1\">\r\n\r\n<my-app>Loading&#8230;<\/my-app>\r\n\r\n    <\/div>\r\n    <div class=\"tab-pane\" id=\"html1\">\r\n\r\n<pre>\r\n(html)\r\n&lt;head>\r\n.....\r\n  &lt;script defer src=\"main.dart\" type=\"application\/dart\">&lt;\/script>\r\n  &lt;script defer src=\"packages\/browser\/dart.js\">&lt;\/script>\r\n&lt;\/head>\r\n&lt;body>\r\n  &lt;my-app>Loading...&lt;\/my-app>\r\n&lt;\/body>\r\n\r\n(pubspec.yaml)\r\n.....\r\nenvironment:\r\n  sdk: '>=1.24.0 <2.0.0'\r\ndependencies:\r\n  angular: ^4.0.0\r\n  angular_forms: ^1.0.0\r\n  angular_router: ^1.0.2\r\n  http: ^0.11.0\r\n  stream_transform: ^0.0.6\r\n\r\ndev_dependencies:\r\n  angular_test: ^1.0.0\r\n  browser: ^0.10.0\r\n  dart_to_js_script_rewriter: ^1.0.1\r\n  mockito: ^2.0.2\r\n  test: ^0.12.21\r\n\r\ntransformers:\r\n- angular:\r\n    entry_points:\r\n    - web\/main.dart\r\n    - test\/**_test.dart\r\n- test\/pub_serve:\r\n    $include: test\/**_test.dart\r\n- dart_to_js_script_rewriter\r\n<\/pre>\r\n\r\n    <\/div>\r\n\r\n    <div class=\"tab-pane\" id=\"script1\">\r\n<pre>\r\nimport 'package:angular\/angular.dart';\r\nimport 'package:angular_forms\/angular_forms.dart';\r\n\r\n@Component(\r\n  selector: 'my-app',\r\n  template: '''\r\n&lt;strong>1)Interpolation&lt;\/strong>\r\n&lt;div>(Double wave brackets)   Country:{{country}},  Gender:{{gender}}&lt;\/div>\r\n&lt;div ngNonBindable>(ngNonBindable)  {{xxxxxx}}&lt;\/div>\r\n  &lt;br \/>\r\n&lt;strong>2)2way data binding&lt;\/strong>\r\n&lt;div>Name:{{name}}&lt;\/div>\r\nInput:&lt;input [(ngModel)]=\"name\" placeholder=\"name\">\r\n    ''',\r\n  directives: const [formDirectives,CORE_DIRECTIVES],\r\n)\r\nclass AppComponent {\r\n  String country = \"Japan\";\r\n  String gender = \"woman\";\r\n  String name = \"sample\";\r\n}\r\n\r\nvoid main() {\r\n  bootstrap(AppComponent);\r\n}\r\n<\/pre>\r\n    <\/div>\r\n  <\/div>\r\n<\/div>\r\n<script type=\"text\/javascript\"  src='http:\/\/dart.honobono-life.info\/wp-content\/themes\/ang\/ngdart4\/binding.dart.js'><\/script>","protected":false},"excerpt":{"rendered":"<p>AngularDart v4 Sample Code,Demo<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=\/wp\/v2\/posts\/118"}],"collection":[{"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=118"}],"version-history":[{"count":1,"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":119,"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions\/119"}],"wp:attachment":[{"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dart.honobono-life.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}