How to use custome oauth in meteor+inoic - meteor

I write a custome oauth module,and add this module to my meteor+ionic project.
I add new method Meteor.loginWithSample,but i can not use this method in my project.
I got
client/imports/app/app-routing.module.ts (9, 8): Property
‘loginWithSample’ does not exist on type 'typeof Meteor
when compile my project.how can i add my method to #types/meteor.
I used meteor cli
I am a newer for typescript

Related

Using Bootstrap-Slider in Vue with Typescript

I'm trying to create a boostrap-slider on my page using a vue backend built with TypeScript and ASP net core. I'm using the standard template for Vue.js with TypeScript in ASP.NET Core.
I've imported the boostrap-slider types with
npm install --save #types/bootstrap-slider
and when I try to
import { Slider } from 'bootstrap-slider';
I get the error
ERROR in [at-loader] ./ClientApp/components/mycomponent/mycomponent.ts:3:24
TS2306: File '~~redacted~~/node_modules/#types/bootstrap-slider/index.d.ts' is not a module.
To achieve your goal you can refer to this MSDN post.
This sample demonstration will help you to setup Vue.js with TypeScript in ASP.NET Core.
Complete Description
setup Vue.js with TypeScript in ASP.NET Core.
Sample Source Code:
Vue.js with TypeScript in ASP.NET Core
To achieve Boorstrap-Slider you can use vue-bootstrap-slider
for further details see link: vue-bootstrap-slider
The error occurs because the type definitions don't export a module, so you can't import it. They do this because you can call the slider functions through jquery:
var someSlider = $("input.slider").slider();
var value = someSlider.slider('getValue');
These functions are properly typed because the typings are found even without any imports.

When use Extension class, when use Compiler Passes in Symfony?

What is the point of using compiler passes in Symfony?
When we should use Extension class and when Compiler Passes in Symfony?
They come with services definition.
By creating a compiler pass, you are able to update the arguments passed to services.
It's most often done with tagged services.
Also, It can be used for :
Creating new services that require information about other defined services before being defined.
Swapping or adding arguments to a service that you did not write.
Creating and modifying parameters in the container.
I used a compiler pass to register a Factory that make me able to override the doctrine Repository.
You can see the code for more comprehension of how it works:
https://gist.github.com/chalasr/77be8eee5e3ecd3c06ec
Update
Thank's to #Sruj, I added the part I've forgotten about the Extension
Extension are part of dependency injection too, especially of the configuration.
Its primary role is to load the configuration of services across the bundles of your application.
Instead of load your configuration manually by using imports, you can create an extension that does it for you. All your services configuration are registered from your bundle and shared in your whole application.
When you register a vendor in your app configuration, the service container extension of the vendor is invoked.
See "Importing configuration via container extensions" part of the documentation

Where is IHttpControllerFactory?

Microsoft website says there is a IHttpControllerFactory which can be used to generate controllers in custom ways.
However, the System.Web.Http DLL referenced from Visual Studio:
packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll
Doesn't have that interface:
So where is the interface now?
It's gone and replaced by a dependency resolver or more specifically the IDependencyResolver interface. Once you write your own dependency resolve you could plug it into the Web API:
config.DependencyResolver = new MyDependencyResolver();
Cannot find it as well.
Anyway you can use IHttpControllerActivator to create your custom controller factories in Web API.

Using the object Silex/Application into a Symfony2 project

I need to use a third party API into a Symfony2 app, which is using composer to manage dependencies.
This API is built using Silex, so I need to use a Silex/Application object.
I have manage to get silex by adding
"silex/silex": "1.0.*"
into composer.json, but when I specify
use Silex/Application
in the controller and
$app = new Silex\Application();
in the action where I want to manage the third party API, the response is:
Fatal error: Class 'MyApp\MyBundle\MyController\Silex\Application' not found in path\to\my\controller\MyController.php on line 130
It seems like the Silex namespace haven't been loaded.
Any idea about how can I manage to use Silex into Symfony2?
If you exported it as use Silex\Application; then $app = new Application();
or use Silex\Application as SilexApp then $app = new SilexApp();

Problem modulating action script project

I am refactoring a hugh action script solution in Flash builder (beta 2) using the flex 4 sdk.
The project does NOT use the mx framework.
What i want to have is:
A big 'MAIN' project
several small 'MODULE' projects. each 'MODULE' class refrences the 'MAIN' project as an External reference (doesnt compile into swf) - this is done by setting link type = external in the 'MODULE' project properties -> library path.
'MAIN' loads a 'MODULE' project on runtime using the 'loader' class.
the problem:
I recieve an error from the MODULE project:
VerifyError: Error #1014: Class [some class in MAIN] could not be found.
PLEASE HELP!
Check which application domain you are loading your module into. The app domain needs to be able to access the class you have externalised or you'll get that error.
It might just be a bug with the beta version of the sdk. It seems like the import of a class in a module created in another project doesn't force it's inclusion in the main swf.
try putting a dummy dependency in you main application class, like:
private var forcedImports:Array = [MyClass];
It fixed some of my problems before.

Resources