Introduced Server Side Rendering for Cloud Pages based on React

This commit is contained in:
tmshv committed 2017-05-20 23:24:18 +03:00
1 parent 569b849457
commit 1d6772eef3
17 files changed
+456 -61

No files matched your search

+13 -4
View File
@@ -233,16 +233,25 @@ app.config(($locationProvider, $routeProvider) => {
})
$routeProvider.otherwise({
templateUrl: '/404.html'
template: '',
controller: function($window) {
console.log('otherwise')
$window.location.reload()
}
})
})
app.run(($location, $rootScope, $http) => {
app.run(($window, $location, $rootScope, $http) => {
$rootScope.$on('$routeChangeSuccess', (event, current) => {
const url = location.href
const title = current['$$route'].title
if (title) $rootScope.title = title
try {
const title = current['$$route'].title
if (title) $rootScope.title = title
} catch (e) {
}
setTimeout(() => {
try {