Click here to Skip to main content
15,883,866 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am created sample app with angularjs and material design

for material design i followed the link is

https://material.angularjs.org/#/getting-started

my html file looks like

HTML
<!DOCTYPE HTML>
<html>
<head>
<link href="Style/angular-material.css" rel="stylesheet" />
<link href="Style/mystyle.css" rel="stylesheet" />
</head>
<body ng-app="fileexpo">
<!--Controller for Button-->
<div ng-controller="directory" ng-init="initialize();">
    <md-toolbar layout="row">
  <h7>Files</h7>

</md-toolbar>
    <md-content style="height: 600px;">
        <md-list>
            <md-item ng-repeat="item in files">
                <md-item-content>
                    <div class="md-tile-left">
                        <img ng-src="{{item.fileimg}}" class="face">
                    </div>
                    <div class="md-tile-content">
                        <h3 ng-click="getname($event, item.listname)">{{item.listname}}</h3>
                    </div>
                </md-item-content>
                <md-divider inset></md-divider>
            </md-item>
        </md-list>
    </md-content>

</div>
<!--end of Controller for Button-->

<!-- Angular Library Dependencies -->

<script src="Lib/angular.js"></script>
<script src="Lib/angular-animate.js"></script>
<script src="Lib/angular-aria.js"></script>
<script src="Lib/angular-material.js"></script>
<script src="cordova.js"></script>
<script src="app.js"></script>
<script src="AppScripts/Controlers/directory.js"></script>



app.js

JavaScript
var filexp = angular.module('fileexpo', ['ngMaterial'])



controller file will have the code

directory.js

JavaScript
filexp.controller('directory', function ($scope) {

$scope.initialize = function () {
    $scope.onDeviceReady();
};


$scope.onDeviceReady = function () {
    $scope.getFileSystem();
};


$scope.getFileSystem = function () {

    $scope.entries = [];
    $scope.dirArr = [];
    $scope.fileArr = [];
    $scope.temp = [];
    $scope.files = [];


    dirArr = [{ "day": "10", "title": "file1" }, { "day": "10", "title": "file2" }];

     fileArr = [{ "day": "10", "title": "file3" }, { "day": "10", "title": "file4" }];

    var filelist = dirArr.concat(fileArr);

    for (var i = 0; i < filelist.length; ++i) {
        var entry = filelist[i];
        // alert(entry.day);
        $scope.files.push({
            fileimg: 'img/folder.png',
            listname: entry.title,
        });
    };
};
});</pre>



The app run in localhost well

But when I created as app (apk) using command link or phonegap build the material design partially working (not working well)

example button displaying but header and list not showing

but the angular js functionalities working well

kindly reply ASSP
Posted
Updated 25-Feb-15 21:49pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900