mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:33:24 +02:00
Adding basic user redirect for external URL.
This commit is contained in:
28
res/app/user/index.js
Normal file
28
res/app/user/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
module.exports = angular.module('stf.user-profile', [])
|
||||
.config(function ($routeProvider) {
|
||||
|
||||
// if CONFIG.externalProfileURL else show page
|
||||
var externalProfileURL = ''
|
||||
var templateString
|
||||
|
||||
if (!externalProfileURL) {
|
||||
templateString = require('./user.jade')
|
||||
}
|
||||
|
||||
$routeProvider
|
||||
.when('/user/:user*', {
|
||||
template: function (params) {
|
||||
console.log('params', params)
|
||||
if (externalProfileURL) {
|
||||
window.location.href = 'http://www.google.com';
|
||||
}
|
||||
|
||||
return '<div></div>'
|
||||
},
|
||||
controller: function () {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
.controller('UserProfileCtrl', require('./user-controller'))
|
||||
Reference in New Issue
Block a user