These are chat archives for filearts/plunker

10th
Aug 2017
sumitra007
@sumitra007
Aug 10 2017 06:43
HI!
Can you send me the same form validation code/link for angular 2 . My email id is : sumitra.unified@gmail.com
NEED SAME FORM VALIDATION CODE OR LINK http://plnkr.co/edit/XbDYKrM2QUf8g1ubTHma?p=gitter IN ANGULAR 2
PLEASE ITS URGENT. sumitra.unified@gmail.com
rahul kumar
@askingrahul
Aug 10 2017 07:02

// Code goes here
var app = angular.module("myApp",[]);

app.controller("addRemoveStore",function($scope){

$scope.sname = "";
$scope.slocation = "";

$scope.stores = [
{sname:"food", slocation:"Patna"},
{sname:"Electronics", slocation:"Delhi"},
{sname:"Tire", slocation:"Dubai"},
{sname:"Bike", slocation:"Bhopal"},
{sname:"Car", slocation:"Bangalore"}
];

 $scope.addstore = function obj(){
   var obj = new object();
  obj.sname=$scope.sname;
  obj.slocation=$scope.slocation;

  $scope.stores.push(obj);
 };

});

can anyone teel me what is the error ?
i am getting this error
ReferenceError: object is not defined
at Scope.obj [as addstore]
chetbis
@chetbis
Aug 10 2017 07:06
@askingrahul it should be new Object(); not new object()
rahul kumar
@askingrahul
Aug 10 2017 07:08
its working. thanks
rahulranjan72
@rahulranjan72
Aug 10 2017 11:44

<md-input-container>
<input mdInput [mdDatepicker]="picker" placeholder="Choose a date">
<button mdSuffix [mdDatepickerToggle]="picker" id="date"></button>
</md-input-container>

<md-datepicker #picker></md-datepicker>

hey i want to open date picker on the top of the text box instead of down
or i some dialog box
rahul kumar
@askingrahul
Aug 10 2017 12:20
<tr ng-repeat="item in stores">
<td>{{$index+1}}</td>
<td>{{item.sname}}</td>
<td>{{item.slocation}}</td>
<td><button type="button" class="btn btn-danger" ng-click="removestore($index)">remove store</button>
<button type="button" class="btn btn-success" ng-click="showform=false">update</button>
</td>
i want to set showform value to false on click button. but it is not working
if i am using outside table it is working
<div class="form" ng-show="showform">
<div class="form-group">
<label for="usr">Store Name:</label>
<input type="text" class="form-control" ng-model="sname" />
</div>
<div class="form-group">
<label for="pwd">location:</label>
<input type="text" class="form-control" ng-model="slocation" />
</div>
<button type="button" class="btn btn-success" ng-click="addstore()">Add Store</button>
<button type="button" class="btn btn-success" ng-click="removeallstore()">Remove All Store</button>

</div>
    <div class="form" ng-hide="showform">
      <div class="form-group">
        <label for="usr">Store Name:</label>
        <input type="text" class="form-control" ng-model="sname" />
      </div>
      <div class="form-group">
        <label for="pwd">location:</label>
        <input type="text" class="form-control" ng-model="slocation" />
      </div>
      <button type="button" class="btn btn-success" ng-click="addstore()">Update Store</button>
      <button type="button" class="btn btn-success" ng-click="showform=true">Back</button>
    </div>
this is the forms

and this the variable which is decleared in controller

$scope.showform = true;

vuhasnovasys
@vuhasnovasys
Aug 10 2017 13:42
can any one say how to insert a image in plunker