نظرات مطالب
فرم‌های مبتنی بر قالب‌ها در Angular - قسمت سوم - Data binding
اعتبار سنجی برای CheckBox list ( حداقل یک آیتم باید انتخاب شود )
مدل برای آیتم ها
export interface SelectedListItem {
  value: string;
  text: string;
  checked: boolean;
}

کامپوننت : 
export class AppComponent implements OnInit {

  selectedListItem: SelectedListItem[] = [];
  
  ngOnInit(): void {
// می‌توان این مقادیر را از یک 
// api 
// دریافت کرد
    this.selectedListItem.push({ value: '1', text: 'Friday', checked: false });
    this.selectedListItem.push({ value: '2', text: 'Monday', checked: false });
    this.selectedListItem.push({ value: '3', text: 'Saturday', checked: false });
    this.selectedListItem.push({ value: '4', text: 'Sunday', checked: false });
    this.selectedListItem.push({ value: '5', text: 'Thursday', checked: false });
    this.selectedListItem.push({ value: '6', text: 'Tuesday', checked: false });
    this.selectedListItem.push({ value: '7', text: 'Wednesday', checked: false });
  }


  save(form, evetn: Event) {
    if (form.valid && this.isValidated()) {
      alert('valid');
    } else {
      alert('invalid');
    }
  }

  isValidated () {
    const selected = this.selectedListItem.filter(x => x.checked === true);
    if (selected && selected.length > 0) {
      return true;
    } else {
      return false;
    }
  }
}

component.html
 <form #form="ngForm" novalidate (submit)="save(form,$event)">
          <div *ngFor="let item of selectedListItem">
            <input type="checkbox" [(ngModel)]="item.checked" name="off">
            <label>
              {{item.text}}
            </label>
          </div>
          
          <p [hidden]=" !form.submitted || isValidated()">
            This field is required
          </p>


          <div>
            <input type="submit">
          </div>
 </form>

اشتراک‌ها
سری ویدیوهای VS Code Day 2021
Join the Visual Studio Code team and community at a live event just for VS Code users. Get a glimpse of things to come and meet the team who works on VS Code every day.
 
سری ویدیوهای VS Code Day 2021
اشتراک‌ها
بررسی Blazor و Razor Component

WHAT IS BLAZOR?

Blazor is a single-page app framework for building interactive client-side Web apps with .NET. Blazor uses open web standards without plugins or code transpilation. Blazor works in all modern web browsers, including mobile browsers. 

بررسی Blazor و Razor Component
اشتراک‌ها
سری آموزشی ASP.NET Core Identity Deep Dive

It’s time that we have an deep dive series for ASP.NET Core Identity that learn to use how ASP.NET Core Identity works and how we can use its powerful feature to have an authentication and authorization system.  

سری آموزشی ASP.NET Core Identity Deep Dive
اشتراک‌ها
کتابخانه gridstack.js

gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column grid. It allows you to build draggable responsive bootstrap v3 friendly layouts. It also works great with knockout.jsangular.js and touch devices.  Demo  Demo

کتابخانه gridstack.js
اشتراک‌ها
پروژه C# to JavaScript Compiler
This compiler can compile C# into JavaScript. By doing this you can leverage all the advantages of C#, such as static type checking, IntelliSense (the kind that works) and lambda expressions when writing code for the browser 
پروژه C# to JavaScript Compiler
نظرات مطالب
Static Reflection
سلام آقای نصیری
باز هم انگار در این پست مشکل اخیر من رو آموزش دادین.یه جورایی خیلی جالبه
من یه قطعه کد دیده بودم برای پیاده سازی INotifyPropertyChanged که در اینجا پرسیدم :
http://stackoverflow.com/questions/6829099/how-this-code-works-for-handling-inotifypropertychanged
البته آقای مارک گراول گفته که این روش سرعتش پایینه. البته من همچنان از کد خیلی سر در نیاوردم. یعنی سلسله مراتبی که انجام داده رو متوجه نمیشم از کجا نشات میگیره

ممنون و موفق باشی