Monday, 31 May 2021

key value display angular

 angular 10 object get key and value ” Code Answer's

  1. <div *ngFor="let item of testObject | keyvalue">
  2. Key: <b>{{item. key}}</b> and Value: <b>{{item.value}}</b>
  3. </div>

Thursday, 27 May 2021

Tuesday, 25 May 2021

get value separate from array of object list

 var students = [{

    name: 'Nick',
    achievements: 158,
    points: 14730
}, {
    name: 'Jordan',
    achievements: '175',
    points: '16375'
}, {
    name: 'Ramon',
    achievements: '55',
    points: '2025'
}];
var nameArray = students.map(function (el) { return el.name; 

Wednesday, 19 May 2021

dynamic form binding

 <form (ngSubmit)="onsubmit()">

<div class="col-sm-6">
                            <div class="form-group" *ngFor="let i of textarray">
                                 <label for="" class="block">{{i.label}} </label>
                              <input name="name" type="text" class="form-control"
                                 [(ngModel)]="i.label">
                            </div>
                            
                          <button class="btn btn-primary">Submit</button>

</div>
                          </form>


   this.entrustservice.getcustomFields().subscribe((responseany) => {

       this.auditLogs = response;
        console.logthis.auditLogs)
//ignore this lines
        function filter(response, query) {
          return Object.values(Object.keys(response)
            .filter(key => new RegExp('^' + query, 'g').test(key))
            .map((key) => response[key]));
        }
        this.datearray=filter(response,'date');
          this.datearray = this.datearray.filter(obj => obj.enabled === true);
        this.textarray=filter(response,'text');
          this.textarray = this.textarray.filter(obj => obj.enabled === true);
        this.dropdownarray=filter(response,'dropdown');
          this.dropdownarray = this.dropdownarray.filter(obj => obj.enabled === true);
        console.log(filter(response, 'date'));
        console.log(filter(response, 'text'));
        console.log(filter(response, 'dropdown'));
            //  this.x=date; ignoe these above lines
      this.dataaarays.push(this.auditLogs);
     console.logthis.auditLogs);
//saving response to array dynamic form
//insead of response bind class save data
      });

  }

onsubmit(){
  console.log(this.dataaarays)
}

angular links

 anular good tutor


good ome

code


dynamiv ui forms


check

chekc

key value

dynmicform


mvc porjects need to work click

Tuesday, 11 May 2021

create xml using model class c#

 public string CreateXML(Object p)

{

XmlDocument xmlDoc = new XmlDocument();   //Represents an XML document, 

  // Initializes a new instance of the XmlDocument class.          

XmlSerializer xmlSerializer = new XmlSerializer(p.GetType());

 Creates a stream whose backing store is memory. 

using (MemoryStream xmlStream = new MemoryStream())

{

xmlSerializer.Serialize(xmlStream, p);

xmlStream.Position = 0;

//Loads the XML document from the specified string.

xmlDoc.Load(xmlStream);

return xmlDoc.InnerXml;

}

}

//call in any method to grab data

string strView = CreateXML(p);

//another xml example with model class

XmlDocument doc = new XmlDocument();

XmlNode docnode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);

doc.AppendChild(docnode);

XmlNode usersNode = doc.CreateElement("CreateOrderTest");

doc.AppendChild(usersNode);

XmlNode userNode = doc.CreateElement("User");

XmlAttribute userAttribute = doc.CreateAttribute("Id");

userAttribute.Value = "1";

usersNode.AppendChild(userNode);

XmlNode nameNode = doc.CreateElement("Name");

nameNode.AppendChild(doc.CreateTextNode("frank"));

userNode.AppendChild(nameNode);

XmlNode addressNode = doc.CreateElement("Adrees");

addressNode.AppendChild(doc.CreateTextNode("1 Main St."));

userNode.AppendChild(addressNode);

var XMLString = doc.InnerXml;

localhost.webservices test = new localhost.webservices();

var res = test.TextXML(XMLString);

return view();


Tuesday, 4 May 2021

Bootstrap carousel

bootstrap carousel

application url

data-interval by default 5ms.
data-sliet-to:number of slides,
data-wrap:false means stop at last slide,
data-pause:false means pause on mouseover(make data-interval :false)
Bootstrap carousel attributes

AttributeDescription
data-intervalSpecifies the time delay in milli-seconds for transitioning from one slide to another. Set this attribute to false if you do not want automatic sliding
data-pauseThe default value is hover. Pauses from transitioning to the next slide on hover. Set this attribute to false to stop the ability to pause on hover
data-wrapThe default value is true which means the carousel transitions thru all the slides without stopping at the last slide. To stop at the last slides set this attribute to false
data-ride="carousel"activates the carousel. The carousel can also be manually activated by using JavaScript
$("#carousel_Id").carousel();
data-slide-toSpecifies which slide to go to when clicked. Slide index is ZERO based
data-slideThis attribute is added to the carousel controls (LEFT and Right buttons). For the left button the value is "prev" and for the right button the value is "next"



Bootstrap carousel classes

ClassDescription
carouselCreates a carousel
slideAdds sliding animation effect when transitioning from one item to the other
carousel-innerThis class is applied on the element that contains all the slides of the carousel
itemSpecifies the conent of each slide. Content can be text and images
carousel-captionSpecifies a caption for the carousel
carousel-indicatorsAdds the dot indicators at the bottom of each slide which indicates the current slide the user is viewing and the the total number of slides
carousel-controlAdds the left or right bottons on the carousel to go back or forward one slide. To add left button, use left class along with carousel-control class and to add right button use right class along with carousel-control

Car pooling app

 I'll create a car pooling app with real-time vehicle tracking, pickup/drop time estimates, and a list of onboard users. Since we don...