+3 votes
by (100 points)

I have the following:

<div>{{ modal.data.text }}</div>

How can I hide the data that shows from view. I don't want it to have any height / width but some other reasons I want it to be added to the DOM.

Note the {{ are from AngularJS and it will substitute the {{ }} for some text when the page displays.

7 Answers

+21 votes
by (100 points)

A more Angular-y way:

<div ng-hide="modal.data.text" ng-bind="modal.data.text"></div>

Explanation: The div will hide when modal.data.text evaluates to true (contains some text in your case), and will also bind the value of modal.data.text to the inner HTML of the div.

+16 votes
by (100 points)

Like this:

<div style="display: none">{{ modal.data.text }}</div>
+14 votes
by (100 points)
#mydiv {
   display:none;
}

<div id="mydiv">{{ modal.data.text }}</div>
+10 votes
by (100 points)

Yes, that's your problem. Sage is basically Python when it comes to syntax (some extra goodies). In Python, the syntax is space and indentation. You only indent after colons (for things like loops, conditionals, definitions). Some good places to start learning basic Python are

+6 votes
by (100 points)

try this

    public static class ViewHolder extends RecyclerView.ViewHolder{

        private TextInputLayout textInputLayout;
        private EditText editText;

        public ViewHolder(View itemView) {
            super(itemView);
            textInputLayout=(TextInputLayout)itemView.findViewById(R.id.textInputLayout);
            editText=(EditText)itemView.findViewById(R.id.text);
            editText.addTextChangedListener(new TextWatcher() {
                @Override
                public void beforeTextChanged(CharSequence s, int start, int count, int after) {

                }

                @Override
                public void onTextChanged(CharSequence s, int start, int before, int count) {

                }

                @Override
                public void afterTextChanged(Editable s) {

                }
            });


        }

        private void colocarModelo(Model model){
            textInputLayout.setHint(model.getHint());
            textInputLayout.getEditText().setText(model.getValor());
        }

    }
+6 votes
by (100 points)

Swift 3:

class MYPTempController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let btn = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
        view.addSubview(btn)
        btn.addTarget(self, action: #selector(MYPTempController.btnClick), for: .touchUpInside)
    }
    @objc fileprivate func btnClick() {
        print("--click--")
    }
}

//带参数
btn.addTarget(self, action: #selector(MYPTempController.btnClick(_:)), for: .touchUpInside)
//监听方法
func btnClick(_ sender: UIButton) {
    print("--click--")
}
+4 votes
by (100 points)

The regex to match a = nt then a number is:

=(nt\d+)

And in your example:

line = .Falies/367. 11DG1550/11DG15537.Axiom=nt60 
line = .Failies/367. 11DG1550/11DG15537.Axiom=nt50 

it will return two matches:

MATCH 1
1.  [49-53] `nt60`
MATCH 2
1.  [105-109] `nt50`

Explanation:

`=` matches the character `=` literally 
1st Capturing group `(nt\d+)`
   `nt` matches the characters `nt` literally (case sensitive)  
   `\d` match a digit `[0-9]`  
   `+` Quantifier: Between one and unlimited times, as many times as possible,  
       giving back as needed  

if you want your regex to match a = word number then just replace the nt with \w+ to match any word.

hope this helps.

No related questions found

...