Author Archives: admin

Ionic 2 Fabs


Ionic 2 Fabs : Fabs Stands for Floating Action Buttons. Fabs are basically Material design Component which are used frequently in mobile devices. Fabs are buttons which prompts set of actions when you click/hover on it. Fabs are placed on the top of the content and their position is fixed when you scroll the page. It is very simple to create fabs in Ionic 2. Here in this tutorial we are going to explain how you can create fabs in Ionic, You can also use our online editor to see the demo.


Ionic 2 Fabs | Buttons | Actions | Icons Example

Let us create first Fabs, this fab will be placed at the top right corner(edge) of the page however you can place it at other corners. –

Ionic 2 Fabs Example:

Try it »

If you run the above example it will produce the output something like this –

Ionic 2 Fabs Example

Attributes

AttributeDescription
miniThis reduces the size of the Fab button

Input Properties

AttrTypeDetails
colorstringYou can change the fab button colors using the predefined colors. For example: “primary”, “secondary”, “danger”.
modestringThe mode to apply to this component. Mode can be ios, wp, or md.


Learn More

Let us create some more examples on Fabs.


Fab Position – Left Edge | Right Edge

You can place the fab to the left edge or right edge(corner) simply as below –

Place Fab Button to Left Edge | Right Edge Example:

The output of the above example will be something like this –

Fab left Right Position Example

Fab Position – Left Bottom | Right Bottom

You can place the fab to the left bottom and right bottom simply as below-

| Example:

The output of the above example will be something like this –

Ionic s Fab Left Bottom | Right Bottom Position

Change Fab Button Color

To change the background color of the Fab Button you can use the input property color to set the predefined color.

How to Change Fab Button Color In Ionic 2 Example:

The output of the above example will be something like this –

Ionic 2 change Fab Button Color

Ionic 2 DateTime


Ionic 2 DateTime DateTime component is used to create datepicker which enables user to select dates and times. Ionic’s datetime component enables us to create the datetime picker in preferred format. Here in this tutorial we are going to explain how you can create date time picker in Ionic 2. You can also use our online editor to edit and run the code online.


Ionic 2 DateTime Example

Let us first create very simple example of the DateTime –

Basic DateTime

It Contains two parts Html and JavaScript, Let us create one by one –

  • 1. HTML Part – It contains the Html Part.
  • 2. Script Part – This contains typescript code for the Alerts.

Html Part : demo.html

Ionic 2 DateTime Basic Eaxmple : Html

JavaScript Part : demo.ts

Now let us create event function Which will add the default time, month and timeEnds in the dateTime Picker-

Ionic 2 DateTime Basic Eaxmple : Html

Try it »

The output of the above example will look something like this –

Ionic 2 Date Time Picker Example

Options For Display & Picker

Following Options are available for display and picker of DatTime which can used easily to format the options –

FormatDescriptionExample
YYYYYear, 4 digits2018
YY Year, 2 digits 18
M Month1 … 12
MM Month, leading zero 01 … 12
MMM Month, short name Jan
MMMM Month, full name January
D Day1 … 31
DD Day, leading zero01 … 31
DDD Day, short name Fri
DDDD Day, full name Friday
H Hour, 24-hour 0 … 23
HH Hour, 24-hour, leading zero 00 … 23
h Hour, 12-hour1 … 12
hh Hour, 12-hour, leading zero 01 … 12
a 12-hour time period, lowercase am pm
A 12-hour time period, uppercase AM PM
m Minute1 … 59
mm Minute, leading zero 01 … 59
s Second1 … 59
ss Second, leading zero 01 … 59
Z UTC Timezone Offset Z or +HH:mm or -HH:mm

jQuery trigger function when element is in viewport


jQuery trigger function when element is in viewport : Sometimes we need to call function when element appears in viewport. There are many ways to check the element postion, we are going to explain the easiest way to check the position of an element using jQuery and then call the function. You can also use our online editor to edit and run the demo online.


jQuery trigger function when element is in viewport | Example

You use the following method to check that element is in viewport or not –

jQuery trigger function when element is in viewport?

Try it »

Ionic 2 Checkbox


Ionic 2 Checkbox Checkbox is an input component which enables user to select one or more items. Checkboxes in Ionic 2 are same as Html input. It is very simple to create Checkboxes in Ionic 2. Here in this tutorial we are going to explain how you can create Checkboxes In Ionic 2. You can also use our online editor to see the output of the example.


Ionic 2 Checkbox | Change Color | Disabled | Checked Example

Checkbox holds Boolean(true/false) values when you check or uncheck it.

Checkbox | Checked | Eaxmple

Here we are going to create simple checheckboxes with default checked & unchecked.

Ionic 2 Checkbox | Check | Uncheck Example

Try it »

The output of the above example will look something like this –

Ionic 2 Checkbox

Options Available

AttributeTypeDescription
colorstringThis is used to add/change the checkbox color. For example: “primary”, “secondary”, “danger”.
modestringThe mode to apply to this component.
checked booleanThis is used to set the check/uncheck property of checkbox(default is false).
disabledbooleanThis is used to disable the checkbox.


Learn More

Let us have some More example and demo about the Ionic 2 Checkboxes.


Ionic 2 Disabled Checkbox Eaxmple

To disable the checkbox in Ionic 2 Add attribute disabled=”true”.

How to disable Checkbox in Ionic 2 Example

The output of the above example will look something like this –

Ionic 2 Checkbox Group | Lists Eaxmple

Sometimes we need to create group of checkbox lists which enables user to select one or more than one item from the list. Here is simple example of the Ionic 2 Group.

Ionic 2 Group | Lists Eaxmple

The output of the above example will look something like this –

Ionic 2 Group List Example

Ionic 2 Cards


Ionic 2 Cards : Cards are basically used to display the important pieces of content, and emerging as the core design pattern for apps. Cards are great way to display the information in organised format. Cards are widely used by companies like – google, twitter and have become one of the most popular design pattern. Here in this tutorial we are going to explain how to create cards in Ionic 2. You can also use our Online tool to run the example and see the output.


Ionic 2 Cards Example

Cards are important component of the apps, it allows to display the same information on different size of screens. It is very simple to create Cards in Ionic 2. Let us understand the cards one by one-

  • 1. Basic Cards
  • 2. Card Headers
  • 3. Card Lists
  • 4. Card Images
  • 5. Background Images
  • 6. Advanced Cards

Let us go one by one to understand the Ionic 2 Cards-

Basic Cards

Cards are basically css component. You can create basic cards simply as below-

Basic Card Header Example

Try it »

The output of the above example will look something like this –

Ionic 2 Cards Example

Card Headers

ion-card-header component is used to add the Header in card. Here is simple example of card headers-

Card Headers Example

Try it »

The output of the above example will look something like this –

Card Headers Example

Lists In Cards

ion-list component is used to create card lists in Ionic 2. Here is simple example of Lists In Cards-

Lists In Card Headers Example

Try it »

The output of the above example will look something like this –

Ionic 2 Lists Cards

Images In Cards

We sometimes need to add images in cards, It is very simple to add images in Cards. Here is an example of Images in Cards.

Ionic 2 Card Images Example

Try it »

The output of the above example will look something like this –

Ionic 2 Card Images

Background Images In Cards

You can set background images in Cards simply adding the image source url as below-

Background Images in Cardss Example

Try it »

The css used in the above example is given below, please don’t forget to add this to add the styles for title and subtitle.

Card Background Image Css:

The output of the above example will look something like this –

Ionic 2 Set Cards Background

Ionic 2 Buttons


Ionic 2 Buttons: Buttons play an important role in navigation of any app, Ionic 2 provides predefined classes to create different-different buttons. Buttons can contain the text and icons which can be enhanced with different-different attributes. Here in this tutorial we are going to explain how you can create buttons in Ionic 2, you can also use our online editor to run and see the output of the example.


Ionic 2 Buttons | Example & Demo

Ionic uses standard html button <button> element to create buttons and ion-button directive to enhance the properties.

Following Buttons are available in Ionic 2-

  • 1. Default Style
  • 2. Outline Style
  • 3. Clear Style
  • 4. Round Buttons
  • 5. Block Buttons
  • 6. Full Buttons
  • 7. Button Sizes
  • 8. Icon Buttons
  • 9. Buttons In Components

Default Style Button

To create default Style add ion-button attribute to the button Add color using color attribute simply as below –

Ionic 2 Default Style Button Example

Try it »

If you run the above example it will produce output something like this –

Ionic 2 Buttons Default Example

Outline Style Button

To create outline Style add outline property to the button simply as below-

Ionic 2 Outline Style Button Example

Try it »

If you run the above example it will produce output something like this –

Ionic 2 Outline Buttons

Clear Style Button

If You want to create Clear Style Button just add clear property simply as below-

Ionic 2 Clear Style Button Example

Try it »

If you run the above example it will produce output something like this –

Ionic 2 Clear Buttons Example

Rounded Buttons

If You want to create rounded Buttons just add round property to button simply as below-

Ionic 2 Rounded Button Example

Try it »

If you run the above example it will produce output something like this –

Ionic 2 Rounded Buttons Example

Block Buttons

Add block property to button to make the block level, it will make button 100% of its parent container. Here is an example of block level button-

Ionic 2 Rounded Button Example

Try it »

If you run the above example it will produce output something like this –

Ionic 2 Block Buttons Example

Full Buttons

Add full property to button create Full width button. Full button will be 100% of it’s parent. It removes the left and right borders of the button. Here is an example of block level button-

Ionic 2 Full Buttons Example

If you run the above example it will produce output something like this –

Ionic 2 Full Buttons

Button Sizes

You can add large attribute to make the buttons large and small to make the buttons small-

Ionic 2 Small | Large Button Example

The output of the above example will look something like this –

ionic 2 button sizes

Icon Buttons

You can create icon buttons using ionic icons simply as in the example below –

Ionic 2 Small | Large Button Example

The output of the above example will look something like this –

Ionic 2 add icons to button

Buttons In Component

You can easily add the buttons in components such as header, footer or list items. Here is an example of a simple search button in header-

Buttons In Component Example

The output of the above example will look something like this –

Search Button in Header Example

Input Properties

AttributeTypeDescription
largeboolean Used to Create Large button.
small boolean Used to Create Small button.
defaultboolean Used to Create Default button.
outlinebooleanThis creates transparent button with a border.
clear booleanThis creates transparent button without a border.
solid booleanThis is used to force a solid button. Useful for buttons within an item.
round booleanThis creates button with rounded corners.
block booleanThis creates button that fills its parent container with a border-radius.
full booleanThis creates button that fills its parent container without a border-radius or borders on th
strong booleanThis is used to represent the important action.
mode stringThe mode to apply to this component.
color stringThe predefined color to use. For example:

Laravel Join 3 Tables


Laravel Join 3 Tables: Joining more than two tables is very common in any framework, we often need to join 3 or more then three table in Laravel. Here in this tutorial we are going to explain how you can join three tables or more than three tables in Laravel.


Laravel Join 3 Tables Example | Join Multiple Tables

It is very simple to join 3 tables in Laravel. Let us create an example to join 3 table –

Laravel Join 3 Tables Example:

The above example will join the three tables – users, orders and order_items on the basis of the foreign keys. You can join multiple tables on the same ways to get the data from different-different tables.

Laravel Check Duplicate Records


Laravel Check Duplicate Records: We often need to check duplicate records when working with database table records. It is very simple to check the duplicate records in Laravel. Here in this tutorial we are going to explain how you can Check duplicate Records in Laravel.


Laravel Check Duplicate Records Example | Laravel check if user exists

Here we have checked that the given email exists in the database table or not. You can simply check the duplicate records in Laravel simply as below-

Laravel Check Duplicate Records Query Example:

The above example will check the given email exists in the database table or not it does not exists then it will return null, Using this response you do other stuffs.

Laravel get Session ID


Laravel get Session ID : Laravel session ID depends upon the version of the Laravel, Here in this tutorial we are going to explain how you can get Session ID in Laravel. We are going to explain how to get Session Id in Different versions of Laravel.


Laravel get Session ID Example

You can get the session Id in different versions of laravel as –

Laravel 3

You can get the Session ID in Laravel 3 simply as below –

Laravel get Session ID Example:

Laravel 4.0

You can get the Session ID in Laravel 4.0 simply as below –

Laravel get Session ID Example:

Laravel 4.1 & Onwards | Laravel 5

You can get the Session ID in Laravel 4.1 and onwards version simply as below –

Laravel get Session ID Example: