The Techies' pub

Get your phone’s market name using your phone’s model name using ng-fone.

Sorry, Its been a longtime since I wrote a post but you know, I was busy as usual experimenting with new stuff and trying to make the world better through technology.

Recently I worked on an application (cordova application) in which I was trying to get the phone’s market name or consumer friendly name. But through my code I was only able to get the model name. I researched a lot online and to my surprise couldn’t get an angular module to perform that. All I found was a list of all devices made by Jared Rummler. So I did what programmers do; yeah, I wrote it.

You can install it using the below command (if you have npm package manager)

npm install ng-fone

To use it in your application just follow the below steps.

Step 1:

After installation please reference it in your html file as shown below:

1

<script src="pathtongFone.js></script>

Step 2:

In your app.js file add ngFone as a dependency.

1

angular.module('yourappname',['ngFone'])

Step 3:

In your controller add fonename as a parameter as shown below.

1

2

3

4

5

.controller('yourctrl',function($scope,fonename){

varmobilename=fonename.getmobilename(model);

})

Now mobilename will contain an object with four keys i.e., marketname, brandname, labelname and Model. They can be accessed like mobilename.marketname or mobilename.labelname.