Multiple Pages In Chrome Packaged Apps
The URL structure inside of Chrome Packaged Apps messes with the AngularJS $routeProvider.
As a solution one can use the following directive:
app.directive("link", function ($location) {
function (scope, element, attrs) {
element.bind("click", function () {
scope.$apply($location.path(attrs.link))
});
}
});
This creates a custom link attribute to be used in the format of
<span link="yourRoute">This is a link that will match your /yourRoute</span>
Written by Talon
Related protips
1 Response
I'm just getting started with AngularJS, but it seemed this only worked for me if I put "return " before "function" on L. 2 and a semicolon to terminate that return.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Chrome
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#