Skip to content

Instantly share code, notes, and snippets.

View shahmeet999's full-sized avatar
🎯

Meet Shah shahmeet999

🎯
View GitHub Profile
package com.example.meet.customadapter;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
<ListView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/lstemp"> 
 
</ListView> 
package com.example.meet.customadapter;
public class employee {
int id;
String name;
public employee(int id, String name) {
this.id = id;
this.name = name;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
package com.example.meet.customadapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;
package com.example.meet.customadapter;
import android.widget.TextView;
public class employee_view_holder {
TextView tvid;
TextView tvname;
public employee_view_holder(TextView tvid, TextView tvname) {
@shahmeet999
shahmeet999 / Utils.ts
Created May 31, 2022 10:59
Check required form fields in Reactive Form in Angular
public reqfields(formName: FormGroup) {
let arr = [];
Object.keys(formName.controls).forEach(formControl => {
if (formName.controls[formControl].errors && formName.controls[formControl].errors != null) {
let obj = {
controlName: formControl,
errors: formName.controls[formControl].errors['required']
}
arr.push(obj);
}