open close dialog design code example

Example 1: open dialog

let dialogRef = dialog.open(UserProfileComponent, {
  height: '400px',
  width: '600px',
});

Example 2: code to close dialog containg layout

AlertDialog.Builder builder = new AlertDialog.Builder(this);

    LayoutInflater inflater = getLayoutInflater();
    View dialogView = inflater.inflate(R.layout.brush_opts_dialog,null);

    builder.setView(dialogView);


    closeBtn = (Button)dialogView.findViewById(R.id.close_btn);


   final AlertDialog dialog = builder.create();

    closeBtn .setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            dialog.dismiss();
        }
    });

    dialog.show();