所以我试图让paypal按钮显示在我的应用程序上,但我无法让它工作.我基于这个jsfiddle. https://jsfiddle.net/rbacekkb/
我试图放入我的应用程序,但按钮没有显示在我想要的页面上.我不知道我做错了什么.
paypal.jsx
import React from 'react';
class PayPalButton extends React.Component {
constructor() {
super();
// you can take this value from a config.js module for example.
this.merchantId = '6XF3MPZBZV6HU';
}
componentDidMount() {
let container = this.props.id;
let merchantId = this.merchantId;
window.paypalCheckoutReady = function() {
paypal.checkout.setup(merchantId, {
locale: 'en_US',
environment: 'sandbox',
container: container,
});
}
}
render() {
return(
<a id={this.props.id} href="/checkout" />
);
}
}
module.exports = PayPalButton;
Run Code Online (Sandbox Code Playgroud)
试图让它出现在这个目前正在测试的页面中.
home.jsx
import React from "react";
import {Grid,Row,Col,Button,Jumbotron, Carousel, Panel} …Run Code Online (Sandbox Code Playgroud) 所以我正在开发一个带角度1的小应用程序,文件上传,我发现有些变化我不知道,因为控制器中编码https的方式现在不同了.由于旧的方式现在导致http.get.success不是一个函数.我需要帮助了解从1.4角度1到我现在必须使用我的控制器执行的当前版本的更改,以便我的其余API中的数据显示在我的HTML上.因为我得到$ http.get(..).成功现在不是函数错误.
gallerycontroller
var galleryCtrl = angular.module('galleryCtrl', []);
galleryCtrl.controller('galleryController', function($scope, $http) {
$scope.superheroes= [];
//Retrieve all the superheroes to show the gallery
$http({
method: 'GET',
url: '/superhero'
})
.success(function (data, status, headers, config) {
console.log(data);
})
.error(function (data, status, headers, config) {
console.log(data)
})
});
gallery.html
<!-- view the gallery of all the superheroes in the db -->
<div class="row">
<div ng-repeat="superhero in superheroes">
<div class="col-md-4 col-xs-6 col-sm-offset-0">
<div class="thumbnail">
<img ng-src="{{superhero.picture.url | fpConvert: {filter:'sharpen', w:300, h:150} }}" />
<div …Run Code Online (Sandbox Code Playgroud)