File

src/modules/firetask/components/ft-tasks-detail/ft-tasks-detail.ts

Metadata

selector ft-tasks-detail
templateUrl ft-tasks-detail.html

Index

Properties
Methods

Constructor

constructor(nav: NavController, navParams: NavParams, tasks: FtTasksProvider, alert: AlertController, utils: FtUtilsProvider, events: Events)
Parameters :
Name Type Optional Description
nav NavController
navParams NavParams
tasks FtTasksProvider
alert AlertController
utils FtUtilsProvider
events Events

Methods

Private addZero
addZero(i: )
Parameters :
Name Type Optional Description
i
Returns : boolean
Public delete
delete(dayIndex: number, taskIndex: number, task: FtTaskInterface)

Removes a Task

Parameters :
Name Type Optional Description
dayIndex number
taskIndex number
task FtTaskInterface
Returns : void
Public isInvalidDay
isInvalidDay()
Returns : boolean
Public save
save(form: any)

Save a task

Parameters :
Name Type Optional Description
form any
Returns : void

Properties

Public alert
alert: AlertController
Type : AlertController
dayIndex
dayIndex: number
Type : number
dayInvalid
dayInvalid: boolean
Type : boolean
Default value : false
entry
entry: FtTaskInterface
Type : FtTaskInterface
Public events
events: Events
Type : Events
Public nav
nav: NavController
Type : NavController
Public navParams
navParams: NavParams
Type : NavParams
new
new: boolean
Type : boolean
Default value : true
submitted
submitted: boolean
Type : boolean
Default value : false
taskIndex
taskIndex: number
Type : number
Public tasks
tasks: FtTasksProvider
Type : FtTasksProvider
Public utils
utils: FtUtilsProvider
Type : FtUtilsProvider
<ion-header>
  <ion-navbar color="secondary">

    <ion-title>{{entry.id ? entry.title:'New Task'}}</ion-title>

    <ion-buttons end>
      <button ion-button icon-only (tap)="delete(dayIndex, taskIndex, entry)" *ngIf="entry.id">
        <ion-icon name="ios-trash-outline" style="margin-right: 5px;"></ion-icon>
      </button>
    </ion-buttons>

  </ion-navbar>
</ion-header>

<ion-content class="task-detail">
  <form #taskForm="ngForm" novalidate>

    <ion-grid>
      <ion-row>
        <ion-col col-7>
          <ion-item>
            <ion-label floating color="dark">Title</ion-label>
            <ion-input [(ngModel)]="entry.title" name="title" type="text" #title="ngModel" spellcheck="false" autocapitalize="off" required>
            </ion-input>
          </ion-item>
          <p ion-text [hidden]="title.valid || submitted == false" color="danger" padding-left class="info">
            Title required
          </p>

        </ion-col>
        <ion-col col-5>


          <ion-item>
            <ion-label floating color="dark">
              Time
            </ion-label>
            <ion-datetime name="time" displayFormat="HH:mm" pickerFormat="HH:mm" [(ngModel)]="entry.time"></ion-datetime>
          </ion-item>


          <p ion-text [hidden]="entry.time || submitted == false" color="danger" padding-left class="info">
            Time required
          </p>
        </ion-col>
      </ion-row>

    </ion-grid>

    <br /><br />
    <ion-title>Weekly repeater</ion-title>
    <p ion-text [hidden]="!dayInvalid" color="danger" text-center>
      Choose at least one day
    </p>
    <br />

    <ion-grid class="days">
      <ion-row>
        <ion-col col-4>

          <ion-item>
            <ion-label>Mon</ion-label>
            <ion-checkbox name="mon" checked="false" [(ngModel)]="entry.days[1]" (ionChange)="isInvalidDay()"></ion-checkbox>
          </ion-item>

        </ion-col>
        <ion-col col-4>

          <ion-item>
            <ion-label>Tue</ion-label>
            <ion-checkbox name="tue" color="dark" [checked]="entry.days[2]" [(ngModel)]="entry.days[2]" (ionChange)="isInvalidDay()"></ion-checkbox>
          </ion-item>


        </ion-col>
        <ion-col col-4>


          <ion-item>
            <ion-label>Wed</ion-label>
            <ion-checkbox name="wed" color="dark" [checked]="entry.days[3]" [(ngModel)]="entry.days[3]" (ionChange)="isInvalidDay()"></ion-checkbox>
          </ion-item>

        </ion-col>
      </ion-row>
      <ion-row>
        <ion-col col-4>

          <ion-item>
            <ion-label>Thu</ion-label>
            <ion-checkbox name="thu" color="dark" [checked]="entry.days[4]" [(ngModel)]="entry.days[4]" (ionChange)="isInvalidDay()"></ion-checkbox>
          </ion-item>

        </ion-col>
        <ion-col col-4>

          <ion-item>
            <ion-label>Fri</ion-label>
            <ion-checkbox name="fri" color="dark" [checked]="entry.days[5]" [(ngModel)]="entry.days[5]" (ionChange)="isInvalidDay()"></ion-checkbox>
          </ion-item>

        </ion-col>
        <ion-col col-4>

          <ion-item>
            <ion-label>Sat</ion-label>
            <ion-checkbox name="sat" color="dark" [checked]="entry.days[6]" [(ngModel)]="entry.days[6]" (ionChange)="isInvalidDay()"></ion-checkbox>
          </ion-item>

        </ion-col>
      </ion-row>
      <ion-row>
        <ion-col col-12>

          <ion-item>
            <ion-label>Sun</ion-label>
            <ion-checkbox name="sun" color="dark" [checked]="entry.days[0]" [(ngModel)]="entry.days[0]" (ionChange)="isInvalidDay()"></ion-checkbox>
          </ion-item>

        </ion-col>

      </ion-row>
    </ion-grid>

    <br /><br />
 
    <ion-item>
      <ion-textarea rows="12" placeholder="Description..." [(ngModel)]="entry.desc" name="description"></ion-textarea>
    </ion-item>

  </form>
  <ion-fab right bottom>
    <button ion-fab color="secondary" (tap)="save(taskForm)"><ion-icon name="checkmark" is-active="false"></ion-icon></button>
  </ion-fab>
</ion-content>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""