This repository has been archived by the owner on Dec 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added code snippets on all example pages
based on http://plnkr.co/edit/OPxzDu?p=preview resolves #29
- Loading branch information
Showing
16 changed files
with
118 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
'use strict'; | ||
|
||
angular.module('esri-map-docs') | ||
.controller('AboutCtrl', function($scope) { | ||
$scope.$parent.page = 'about'; | ||
.controller('AboutCtrl', function() { | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
angular.module('esri-map-docs') | ||
.controller('NavCtrl', function($scope) { | ||
|
||
function getPathParts(path) { | ||
if (!path) { | ||
return []; | ||
} | ||
return path.slice(path.indexOf('/') + 1).split('/'); | ||
} | ||
|
||
// set page based on route | ||
$scope.$on('$routeChangeStart', function(event, next, current) { | ||
var pathParts = getPathParts(next.originalPath); | ||
$scope.page = pathParts.length > 0 ? pathParts[0] : ''; | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
'use strict'; | ||
|
||
angular.module('esri-map-docs') | ||
.controller('ExamplesCtrl', function($scope) { | ||
$scope.$parent.page = 'examples'; | ||
.controller('ExamplesCtrl', function() { | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use strict'; | ||
|
||
angular.module('esri-map-docs') | ||
.controller('SnippetsCtrl', function($scope) { | ||
|
||
function getPathParts(path) { | ||
if (!path) { | ||
return []; | ||
} | ||
return path.slice(path.indexOf('/') + 1).split('/'); | ||
} | ||
|
||
// parse snippet include file locations from route | ||
function getTabs(path) { | ||
var pathParts = getPathParts(path), | ||
tabs, | ||
page; | ||
if (pathParts.length === 0) { | ||
return; | ||
} | ||
page = pathParts[0]; | ||
if (!page) { | ||
return; | ||
} | ||
if (page === 'examples' && pathParts.length > 1) { | ||
tabs = []; | ||
tabs.push('app/examples/' + pathParts[1] + '.html'); | ||
tabs.push('app/examples/' + pathParts[1] + '.js'); | ||
return tabs; | ||
} | ||
} | ||
|
||
// update snippet parameters based on route | ||
$scope.$on('$routeChangeStart', function(event, next/*, current*/) { | ||
$scope.tabs = getTabs(next.originalPath); | ||
$scope.currentTab = $scope.tabs && $scope.tabs.length > 0 ? $scope.tabs[0] : null; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hi |