Disabling Front Matter so Developer Can Use Own Routing #501
Comments
Maybe someone from this issue knows: |
This works for me:
// Copies your app's page templates and generates URLs for them
gulp.task('copy-templates', ['copy'], function() {
return gulp.src('./client/templates/**/*.html')
// .pipe(router({
// path: 'build/assets/js/routes.js',
// root: 'client'
// }))
.pipe(gulp.dest('./build/templates'))
;
});
<script src="/assets/js/foundation.js"></script>
<!-- <script src="/assets/js/routes.js"></script> -->
<script src='//maps.googleapis.com/maps/api/js?sensor=false'></script>
<script src="/assets/js/app.js"></script>
angular.module('application', [
...
//foundation
'foundation',
// 'foundation.dynamicRouting',
// 'foundation.dynamicRouting.animations',
...
])
.config(
function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('yourstate', {
url: '/yoururl',
templateUrl: 'templates/yourTemplate.html',
controller: 'YourController',
resolve: {
// you can use resolve here, yay!
// promiseFooData: ['Restangular', function(Restangular) {
// return Restangular.one('foo').get();
// }]
}
});
})
.run(run)
; You need a ---
name: yourstate
url: /yoururl
controller: YourController
--- Hope this helps. |
What @escapedcat said will work. The module There's one caveat right now, which is that view animation doesn't work without the $stateProvider
.state('home', {
url: '/',
templateUrl: 'templates/home.html',
animation: {
enter: 'slideInDown',
leave: 'fadeOut'
}
}); The change is already in master if you want to mess around with it. |
I'm interested in this also. I have Foundation Apps integrated into a Rails project, and I would like to use all of the UI components but continue to use the Rails routing functionality and HAML templates, at least through initial development, after which I'll probably want to build out the Rails app's API and convert over to Angular for all front-end. |
@mikestecker The front matter routing is totally optional, and we took out the line saying it's required from the documentation. We're trying to put out v1.1 today, which will make view animation work without the router plugin, so you can write your own states but still set up transitions between them. |
@gakimball great thanks. I'll wait for v1.1 today and see how I can modify the project to only use the UI components. |
@gakimball I haven't seen the v1.1 update yet today but I did pull the latest from the repo. This on it's own still didn't work the way I want it to, but removing |
I have disabled the dynamicRouting and dynamicRouting.animations modules and configured my own states with the animation property, but there are no animations. Any advice? |
@olegpolyakov So, the awkward thing right now is that you still need those modules enabled to make view animation work, even if you're not using the Front Matter stuff. We were able to separate the functionality, but we haven't yet separated the modules themselves, to maintain backwards compatibility. We'll do that in a future version when we can properly deprecate it. |
How does one disable front matter routing so that I can take advantage of UI-Router myself? Any known solutions? I looked over the docs but couldn't find anything, and I don't know how the front matter is tied into how the states work with the controllers and such. In the Foundation for Apps docs it says "This app depends on the use of front matter". Is there a way to disable this? If not can we make it a Feature Request?
Thank You for any feedback, information, or suggestions.
The text was updated successfully, but these errors were encountered: