我的问题非常经典.我有一个应用程序的私有部分,后面是一个login form.登录成功后,它将转到管理应用程序的子路由.
我的问题是我无法使用,global navigation menu因为路由器试图在我AdminComponent而不是我的路由AppCompoment.所以我的导航打破了.
另一个问题是,如果有人想直接访问URL,我想重定向到父"登录"路由.但我不能让它发挥作用.在我看来,这两个问题是相似的.
知道如何做到这一点?
所以我有这个使用materializecss javascript的滑块组件.所以在渲染之后,我需要执行
$(document).ready(function(){
$('body').on('Slider-Loaded',function(){
console.log('EVENT SLIDER LOADED');
$('.slider').slider({full_width: true});
$('.slider').hover(function () {
$(this).slider('pause');
}, function () {
$(this).slider('start')
});
});
});
Run Code Online (Sandbox Code Playgroud)
但是我不知道将这行放在哪里因为typescript/angular删除模板中的脚本标记.我已经在ts文件中包含了JQuery,并且希望使用事件系统,但这似乎不起作用.有任何想法吗?这是ts文件的代码:
/// <reference path="../../typings/main.d.ts" />
import {Component, Input} from 'angular2/core';
import { RouterLink } from 'angular2/router';
import {ServerService} from './server';
@Component({
selector: 'slider',
templateUrl:'/app/template/slider.html',
directives: [ ],
})
export class SliderComponent {
@Input() images;
private server: ServerService;
public constructor(server: ServerService){
this.server = server;
}
ngOnInit() {
console.log("THROWING EVENT");
$('body').trigger('Slider-Loaded');
}
}
Run Code Online (Sandbox Code Playgroud) 我有这个问题.我已按照本教程 - > http://www.youtube.com/watch?v=rzRR1i-F_VA
在设置好所有内容后,我在完成身份验证过程中遇到了一些问题.经过一些关于身份验证的研究,我对此进行了测试 - > https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/ug_sandbox/
在进程中的某个时刻(制作测试请求),我在bash控制台中测试了它,我的用户ID,密码和签名都有效.所以我认为问题出在我使用的代码中.
所以这是代码:
<?php
class PaypalTest extends CComponent{
public $api_user = "**********************";
public $api_pass = "***********";
public $api_sig = "**************************";
public $app_id = "APP-80W284485P519543T";
public $apiUrl = 'https://svcs.sandbox.paypal.com/AdaptivePayments/';
public $paypalUrl="https://www.paypal.com/webscr?cmd=_ap-payment&paykey=";
public $headers;
public function __construct(){
$this->headers = array(
"X-PAYPAL-SECURITY-USERID: ".$this->api_user,
"X-PAYPAL-SECURITY-PASSWORD: ".$this->api_pass,
"X-PAYPAL-SECURITY-SIGNATURE: ".$this->api_sig,
"X-PAYPAL-REQUEST-DATA-FORMAT: JSON",
"X-PAYPAL-RESPONSE-DATA-FORMAT: JSON",
"X-PAYPAL-APPLICATION-ID: ".$this->app_id,
);
}
public function getPaymentOptions($paykey){
}
public function setPaymentOptions(){
}
public function _paypalSend($data,$call){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->apiUrl.$call);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, …Run Code Online (Sandbox Code Playgroud)