Wijmo UI for the Web
AngularJS and wijfileexplorer
Wijmo User Guide > AngularJS Directives > AngularJS and wijfileexplorer

In this Angular getting started guide, you'll learn how to use the wijfillexplorer in an HTML project using HTML markup, jQuery script, and AngularJS directives.

For more complex samples that have the controller and model in separate files, see the AngularJS Directive Gallery on our web site.

  1. Add the following code and save the document with an .html extension to create a new HTML page in your favorite text editor.
  2. Add links to the dependencies to your HTML page within the <head> tags. Find the latest dependencies in the content delivery network (CDN) file at wijmo cdn. Along with our usual references, we add two script references for Angular that must come after the jQuery references, so they are the last two lines:
    • For AngularJS itself.
    • For Wijmo's Angular javascript integration library.

    Drop down and copy references to paste inside the head tags

    References
    Copy Code
        <meta charset="utf-8">
    
    <!--jQuery References-->
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
    
    <!-- Angular-->
    <!--<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js" type="text/javascript" ></script>-->
    <script src="AngularScripts/angular.js"></script>
    
     <!--Wijmo Widgets CSS and script -->
    <link href="http://cdn.wijmo.com/themes/aristo/jquery-wijmo.css" rel="stylesheet" title="metro-jqueryui" type="text/css" />
    <link href="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20183.140.min.css" rel="stylesheet" />
    <script src="http://cdn.wijmo.com/jquery.wijmo-open.all.3.20161.90.min.js"></script>
    <script src="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20161.90.min.js"></script>
    <script src="http://cdn.wijmo.com/interop/angular.wijmo.3.20161.90min.js"></script>
  3. Within the <head> tags, below the references, add the following script to set the app to use Wijmo, and to create a simple controller with a $scope parameter to control data context.

    Drop down and copy references to paste inside the head tags

    Script
    Copy Code
    <script>
        function myCtrl($scope) {
         //set initial path
            $scope.currentFolder = "~/Example";
        }
    </script>
  4. Add the following markup within the <body> tags to create the widget. To see how this is done in jQuery without Angular, see Wijfileexplorer Quick Start.
    We use a <wij-wijfileexplorer> directive to create the widget, and set several options as attributes within the element:

    ◾Set the action-uri option to specify the files and folders to display.
    ◾Set init-path option to specify the initial path of the folder to display.
    ◾Set the current-folder option to specify the folder to display. 

    Drop down and copy references to paste inside the head tags

    Script
    Copy Code
    currentFolder: <span>{{currentFolder}}</span>
    <wij-fileexplorer init-path="~/Example" action-uri="fileexplorer.ashx" currentFolder="currentFolder">
    </wij-fileexplorer>

See Also

Widgets