private

Angular 6 private methods

跟風遠走 提交于 2019-12-09 15:54:12
问题 We are upgrading to Angular 6 from 5. We have a shared library that we are getting build errors. Being a Java shop, we got in the habit of marking our component methods and attributes private. In Angular 6 when building our library (after converting and using the new library CLI capability), we get: Property 'getCurrentYear' is private and only accessible within class. In effect any attribute or method used in a template html cannot be marked private anymore on the component class. Of course

Why can private helper methods still be accessed in views?

会有一股神秘感。 提交于 2019-12-09 14:52:25
问题 Just another "why is it that way" question: I noticed that private helper methods still can be accessed within views. Why's that? And is there a way to prevent this (e.g. when having helper methods that should only be called from within another helper)? 回答1: Helpers are modules that get mixed in to the views. This means that public, protected and private methods in the helper become public, protected and private methods on the views. I don't think that you can actually hide the helper methods

Private or Public MSMQ

喜你入骨 提交于 2019-12-09 03:33:44
问题 We are using Queue for few of are WCF services. We are using NetMSMQ binding for the WCF services which use Private MSMQ. The system works OK on our QA environment. I am not sure of any real difference between and private or public queue. The client application are on seperate machine still are able to access Private queue of the WCF service on other box. I am not sure if this is the right thing to do. are there any security related differences between private and public MSMQ. Can someone put

Is there a way to invalidate NSBundle localization cache, withour restarting application? [iOS]

廉价感情. 提交于 2019-12-09 00:39:30
问题 Let's assume that we can change in runtime Localizable.strings, that is placed in NSBundle At the current moment, even if we change it's contents, NSLocalizedString would return old(cached) values. Run Application Get LocalizableString for specific key1 <- value1 Change Localizable.strings key1 = value2 <-- Do something in application to invalidate Localization cache --> Check if LocalizableString for specific key1 == value2 What I've already tried: [[NSBundble mainBundle]

Does a friend see base classes?

◇◆丶佛笑我妖孽 提交于 2019-12-08 20:27:22
问题 Given the sample code: class Base { public: bool pub; protected: bool prot; }; class Derived : private Base { friend class MyFriend; }; class MyFriend { Derived _derived; void test() { // Does standard provide me access to _derived.pub and _derived.prot? cout << "Am I allowed access to this: " << _derived.pub << " and this: " << _derived.prot; } }; Does being a friend give me all access I would get as if I was a member function within the class to which I am a friend? In other words, can I

Is it possible to create private property in Objective-C?

旧城冷巷雨未停 提交于 2019-12-08 17:28:07
问题 Is it possible to create private property in Objective-C? I do know that a kind of private property functionality could be implemented in another way but I'm interested in particular question. Thanks. 回答1: Yes, you can, but the code will looks a little bit strange. And it will only give you some warning if you call, you have to check for the warnings yourself in your implementation file .m @interface YourObject () @property (nonatomic, retain) NSMutableArray *infoArray; @end 来源: https:/

What does Module.private_constant do? Is there a way to list only private constants?

家住魔仙堡 提交于 2019-12-08 16:49:30
问题 Starting in Ruby 1.9.3, we can create private constants: module M class C; end private_constant :C end Is there a good documentation about what this does? Is there a way to get the names of only private constants similar to calling constants 回答1: As of Ruby 2.1, while Module#constants includes only public constants, if you set inherit=false , you will get private constants as well. So if you find a constant in constants(false) but not in constants (and you don't care about inherited constants

C++ - Constructor overloading - private and public

佐手、 提交于 2019-12-08 16:42:16
问题 Can you tell me why the following code is giving me the following error - call of overloaded "C(int)" is ambiguous I would think that since C(char x) is private, only the C(float) ctor is visible from outside and that should be called by converting int to float. But that's not the case. class C { C(char x) { } public: C(float t) { } }; int main() { C p(0); } 回答1: This is discussed in "Effective C++" by Scott Meyer. The reason this is ambiguous is that they wanted to ensure that merely

Composer Private Repository .git-folder keeps being generated

时光怂恿深爱的人放手 提交于 2019-12-08 13:10:38
问题 I could not find a solution for this, so I'm asking for help here. I created a private Git-Repository on Bitbucket, which I want to use within my composer-project. Everything is working so far. The thing is, a .git-folder keeps being generated, which I really don't want to have. (I just want to use the package from a private-repository, nothing else!) My composer.json in the root-project looks like this: { ... "require": { "vendorname/packagename": "*" }, "repositories": [ "type": "git", "url

public method returns private class instance in Java?

五迷三道 提交于 2019-12-08 12:18:30
问题 I have a method that returns an instance of a private class and I need access to its methods from a different package for unit testing. These classes live in the same file. It goes like this: file: A.java public class A{ B b; public B getB(){ return b; } public setB(B b){ this->b = b; } } class B{ C c; public C getC(){ return c; } public setC(C c){ this->c = c; } } class C{ public int getInt(){ return 1; } } So... Basically the question is: are any of the methods in B or C reachable somehow?