Angular Service
any code that touches outside of the boundaries of a component should exist in a service
this includes inter-component communication,
unless there's a parent-child relationship and API calls of any kind and any code that cache or retrieve
data from a cookie or the browser's localStorage. This is a critical architectural pattern that keeps your
application maintainable in
Date: November 16, 2020, 5:15 pm Author: Akram Hossain
Windows chocolatey is a command-line interface based package manager.
Chocolatey can be used for automated software installation, remove and upgrade.
To install Chocolatey on Windows, you will need to run an elevated command shell:
Launch the Start menu
Start typing in PowerShell
You should see Windows PowerShell Desktop App as a search result
Right-click on Windows PowerShell and sele
Date: November 16, 2020, 3:36 pm Author: Akram Hossain
Initiation
Node.js is an open-source, cross-platform, back-end JavaScript runtime environment
that runs on the V8 engine and executes javaScript code outside a web browser
Prerequisites for installing Node.js
If you are using Ubuntu 20.04. Before we start, we should have an user account with sudo privileges set up on the system.
We will learn how to do this by following these steps for Ub
Date: October 11, 2020, 11:16 pm Author: Akram Hossain
To filter relational table in TypeORM using findAndCount there is a workaround. To filtering based on relation fields for findAndCount.
We need to use ObjectLiteral-style where using this style conditions are works perfectly.
Assume that we have Three entities – products,attributeSet and woodType. products belongs to one attributeSet and one woodType,
attributeSet and woodType has many prod
Date: July 17, 2020, 10:46 am Author: Akram Hossain
Typeorm is an ORM Which run in NodeJS, PhoneGap, Cordova, Ionic, Browser, NativeScript, Expo, React Native and Electron platforms.
We can use TypeORM with TypeScript and JavaScript (ES5, ES6, ES7, ES8).
TypeORM is highly influenced by other ORMs such as Entity Framework, Hibernate, Doctrine.
To generate model using TypeORM from existing database we need to install typeorm-model-generator. To
Date: July 16, 2020, 5:58 pm Author: Akram Hossain
react-paginate is a ReactJS component to implement pagination to react js project.
By installing this component and writing only a little bit of CSS code we can accomplish pagination.
Installation:
to Install react-paginate with npm please run the following command in terminal$ npm install react-paginate --save
Usages:
To use this feature we need to import it in top of our class as likeimport
Date: November 8, 2019, 12:45 pm Author: Akram Hossain
To customize date and time PHP provides us some important functions such date, strtotime and mktime. In this post i will demonstrate some usages for these
functions.
Example 1:
Get year start and end date for the current year we can use
$yearStart = date("Y-m-d", strtotime('this year January 1st'));
$yearEnd = date("Y-m-d", strtotime("this year December 31st"));
Example 2:
Get month start a
Date: September 13, 2017, 8:17 am Author: Akram Hossain
While generating a CSV using PHP sometimes we stumbled upon one common problem
where any special character like £ becomes ASCII in generated CSV file,
the reason behind this is the encoding of generated CSV is wrong and
we need to output CSV in UTF8 format, so we will be able to use special ASCII characters in CSV file.
Using example below we can encode UTF8 generated CSV file,
We ne
Date: February 1, 2016, 12:25 pm Author: Akram Hossain
Yii2 model scenarios can be used differently. Lets say, we have a model as Customer Which can be used to store customer sign-in inputs, but it can be also used for the customer sign-up purpose. In different scenarios, Yii2 model can be used in multiple business rules and logic.the email attribute may be required during customer sign-up, but not required customer sign-in.
Yii2 model uses the y
Date: December 17, 2015, 10:58 am Author: Akram Hossain
Yii2 web application project, sometimes we need to current controller ID, action ID.
Specially when we need role based access control, we need to check the controller ID as well as action ID.
Using Yii2 view context api we can get these data.
for example if we need controller ID we can use below code
$controller = $this->context->action->controller->id;
if we need action ID only we can use as
Date: July 23, 2015, 5:07 pm Author: Akram Hossain
In this blog post i will try to explain jQuery text(), html(), and val() methods, there defination and uses.
jQuery text():
From the matched element jQuery text() method get the text contents of the particular element or Sets or returns the text content of selected elements
The following example demonstrates how to set content with the jQuery text()
$("#btn1").click(function(){ $("#test
Date: July 23, 2015, 10:50 am Author: Akram Hossain
Today we will discuss how to implement pagination to any Yii2 web application.
The pagination represents information relevant to pagination of data items fetch from any data sources.
When we need data to be rendered in multiple pages,this can be used to display information such as total item count, page size, current page.
Pagination implementation has two steps.
Fetch data from data source
Date: July 22, 2015, 6:09 pm Author: Akram Hossain