如何使用 Angular2 初始化 Parse 并指向 serverURL [英] How to initialize Parse and point to serverURL using Angular2

查看:27
本文介绍了如何使用 Angular2 初始化 Parse 并指向 serverURL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Parse 服务器,目前遇到了在 javascript 中初始化 Parse 并指向正确的 serverURL 的问题.想知道是否还有其他人有幸使用 Angular2 做到这一点?

I am attempting to use a Parse server and am currently running into issues with initializing Parse in javascript and pointing to the correct serverURL. Curious if anyone else has had any luck doing this with Angular2 yet?

推荐答案

我在 Angular 1 应用程序中使用 Parse 服务器,但代码对两者都适用.我在自己的 Parse 服务中初始化 Parse,它提供了一些方便的辅助方法.但我认为你在哪里运行这段代码并不重要.

I'm using Parse server within an Angular 1 application, but the code works for both. I'm initializing Parse in a own Parse service, which provides some handy helper methods. But I think it doesn't matter where you run this code.

var appId = 'appId';
var jsKey = 'jsKey'; // I think this is not used anymore
Parse.initialize(appId, jsKey);
Parse.serverURL = 'yourNewServerUrl.com';

这篇关于如何使用 Angular2 初始化 Parse 并指向 serverURL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆