Angular Dart: material input initial value











up vote
0
down vote

favorite












I am using angular dart to create a web application.



I have a page where i use material input to get input from the user. in that, i need to have a default initial value in the text box as soon as the page is loaded.



I don't want to bind the input to any variable as this is just a one time use and i will not need binding from component to template after this.



is there a way to specify default/initial value for 'material-input' in dart?










share|improve this question






















  • "I don't want to bind the input to any variable as this is just a one time use" how will you handle user input? I think you need to bind to a variable.
    – Günter Zöchbauer
    Nov 8 at 10:20










  • <material-input ngModel="default initial value">
    – G. Tranter
    Nov 8 at 21:43










  • i solved it using [ngModel]="value". Thanks all.
    – Sabareesh
    Nov 10 at 18:54















up vote
0
down vote

favorite












I am using angular dart to create a web application.



I have a page where i use material input to get input from the user. in that, i need to have a default initial value in the text box as soon as the page is loaded.



I don't want to bind the input to any variable as this is just a one time use and i will not need binding from component to template after this.



is there a way to specify default/initial value for 'material-input' in dart?










share|improve this question






















  • "I don't want to bind the input to any variable as this is just a one time use" how will you handle user input? I think you need to bind to a variable.
    – Günter Zöchbauer
    Nov 8 at 10:20










  • <material-input ngModel="default initial value">
    – G. Tranter
    Nov 8 at 21:43










  • i solved it using [ngModel]="value". Thanks all.
    – Sabareesh
    Nov 10 at 18:54













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am using angular dart to create a web application.



I have a page where i use material input to get input from the user. in that, i need to have a default initial value in the text box as soon as the page is loaded.



I don't want to bind the input to any variable as this is just a one time use and i will not need binding from component to template after this.



is there a way to specify default/initial value for 'material-input' in dart?










share|improve this question













I am using angular dart to create a web application.



I have a page where i use material input to get input from the user. in that, i need to have a default initial value in the text box as soon as the page is loaded.



I don't want to bind the input to any variable as this is just a one time use and i will not need binding from component to template after this.



is there a way to specify default/initial value for 'material-input' in dart?







templates dart angular-material angular-dart






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 at 10:13









Sabareesh

12




12












  • "I don't want to bind the input to any variable as this is just a one time use" how will you handle user input? I think you need to bind to a variable.
    – Günter Zöchbauer
    Nov 8 at 10:20










  • <material-input ngModel="default initial value">
    – G. Tranter
    Nov 8 at 21:43










  • i solved it using [ngModel]="value". Thanks all.
    – Sabareesh
    Nov 10 at 18:54


















  • "I don't want to bind the input to any variable as this is just a one time use" how will you handle user input? I think you need to bind to a variable.
    – Günter Zöchbauer
    Nov 8 at 10:20










  • <material-input ngModel="default initial value">
    – G. Tranter
    Nov 8 at 21:43










  • i solved it using [ngModel]="value". Thanks all.
    – Sabareesh
    Nov 10 at 18:54
















"I don't want to bind the input to any variable as this is just a one time use" how will you handle user input? I think you need to bind to a variable.
– Günter Zöchbauer
Nov 8 at 10:20




"I don't want to bind the input to any variable as this is just a one time use" how will you handle user input? I think you need to bind to a variable.
– Günter Zöchbauer
Nov 8 at 10:20












<material-input ngModel="default initial value">
– G. Tranter
Nov 8 at 21:43




<material-input ngModel="default initial value">
– G. Tranter
Nov 8 at 21:43












i solved it using [ngModel]="value". Thanks all.
– Sabareesh
Nov 10 at 18:54




i solved it using [ngModel]="value". Thanks all.
– Sabareesh
Nov 10 at 18:54












2 Answers
2






active

oldest

votes

















up vote
1
down vote













You're probably looking for hintText.



<material-input hintText="Initial value">
</material-input>





share|improve this answer




























    up vote
    0
    down vote













    From the notes above:



    <material-input [ngModel]="value">


    Was the solution he used. This will push the value into the input without having it be a two way variable. Nate's suggestion of using hintText is also a good use of this.






    share|improve this answer





















      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














       

      draft saved


      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53205569%2fangular-dart-material-input-initial-value%23new-answer', 'question_page');
      }
      );

      Post as a guest
































      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      You're probably looking for hintText.



      <material-input hintText="Initial value">
      </material-input>





      share|improve this answer

























        up vote
        1
        down vote













        You're probably looking for hintText.



        <material-input hintText="Initial value">
        </material-input>





        share|improve this answer























          up vote
          1
          down vote










          up vote
          1
          down vote









          You're probably looking for hintText.



          <material-input hintText="Initial value">
          </material-input>





          share|improve this answer












          You're probably looking for hintText.



          <material-input hintText="Initial value">
          </material-input>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 9 at 23:55









          Nate Bosch

          56429




          56429
























              up vote
              0
              down vote













              From the notes above:



              <material-input [ngModel]="value">


              Was the solution he used. This will push the value into the input without having it be a two way variable. Nate's suggestion of using hintText is also a good use of this.






              share|improve this answer

























                up vote
                0
                down vote













                From the notes above:



                <material-input [ngModel]="value">


                Was the solution he used. This will push the value into the input without having it be a two way variable. Nate's suggestion of using hintText is also a good use of this.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  From the notes above:



                  <material-input [ngModel]="value">


                  Was the solution he used. This will push the value into the input without having it be a two way variable. Nate's suggestion of using hintText is also a good use of this.






                  share|improve this answer












                  From the notes above:



                  <material-input [ngModel]="value">


                  Was the solution he used. This will push the value into the input without having it be a two way variable. Nate's suggestion of using hintText is also a good use of this.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered yesterday









                  Ted Sander

                  1,08627




                  1,08627






























                       

                      draft saved


                      draft discarded



















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53205569%2fangular-dart-material-input-initial-value%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest




















































































                      Popular posts from this blog

                      Landwehr

                      Reims

                      Schenkenzell