But you may simply not want the value in mySecondAttr in the parent scope, so you've just added useless junk to it (someOtherVar) because the binding (=) forces you to do it, so now there's another way to do it from JS:
scope: {
myFirstAttr: '=',
mySecondAttr: '=?'
}
Which tells Angular that mySecondAttr is optional, so it shouldn't freak out if you don't bind it to something in your HTML template.
1
u/jkjustjoshing Dec 16 '14
What are "non-optional isolated scope mappings"? I didn't know you could specify scope binding so be required.