Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Add support controllerAs sintax #789

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "foundation-apps",
"main": [
"scss/foundation.scss",
"dist/js/foundation-apps.js",
"dist/js/foundation-apps-templates.js"
],
"dependencies": {
"viewport-units-buggyfill": "~0.4.1",
"tether": "~0.6.5",
"fastclick": "~1.0.6",
"angular": "1.3.x - 1.4.x",
"angular-ui-router": "~0.2.12",
"angular-animate": "~1.4.7",
"hammerjs": "~2.0.4"
},
"homepage": "https://github.com/zurb/foundation-apps",
"description": "A responsive, Angular-powered framework for web apps from ZURB.",
"keywords": [
"web apps",
"responsive design",
"angular"
],
"license": "MIT",
"ignore": [
"**/.*",
"bower_components",
"build",
"docs",
"node_modules",
"tests",
"CONTRIBUTING.md",
"Gemfile",
"Gemfile.lock",
"gulpfile.js",
"karma.conf.js",
"package.json",
"scss/_includes.scss"
],
"devDependencies": {
"angular-mocks": "~1.4.7",
"angular-highlightjs": "~0.4.3",
"allmighty-autocomplete": "*",
"marked": "~0.3.2",
"jsdiff": "~1.0.8",
"bootcamp": "~1.1.7"
},
"version": "1.2.0",
"_release": "1.2.0",
"_resolution": {
"type": "version",
"tag": "v1.2.0",
"commit": "aeb6a9dd4debde3449cf9415da3820deb973c30f"
},
"_source": "git://github.com/zurb/foundation-apps.git",
"_target": "~1.2.0",
"_originalSource": "foundation-apps"
}
17 changes: 11 additions & 6 deletions js/angular/services/foundation.dynamicRouting.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@
parent: page.parent || '',
controller: getController(page),
data: getData(page),
animation: buildAnimations(page),
animation: buildAnimations(page)
};


if (page.controllerAs) {
state.controllerAs = page.controllerAs;
}

$stateProvider.state(page.name, state);
}
});
Expand All @@ -64,17 +68,18 @@
'': buildState(page.path, page)
}
};

angular.forEach(page.children, function(sub) {
state.views[sub.name + '@' + page.name] = buildState(sub.path, page);
});

if (page.controllerAs) {
state.controllerAs = page.controllerAs;
}
$stateProvider.state(page.name, state);
});
};

this.$get = angular.noop;

function getData(page) {
var data = { vars: {} };
if (page.data) {
Expand All @@ -88,7 +93,7 @@
angular.extend(data.vars, page);
return data;
}

function buildState(path, state) {
return {
templateUrl: path,
Expand Down