How BitcoinJS sync bitcoin blockchain/transaction data? I see the reference code in BitcoinJS website about 'Creating a Transaction':

var tx = new bitcoin.TransactionBuilder()

// Add the input (who is paying):
// [previous transaction hash, index of the output to use]
var txId = 'aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31'
tx.addInput(txId, 0)


My question is how it get the data about tx(like its inputs/outputs)? Does it link to some nodes or API like blockchain.info?
BitcoinJS does not link directly to the bitcoin network, it is simply a collection of bitcoin-related functions. 

Taking your example above, if we wanted to create a transaction with BitcoinJS' transaction builder function, we would have to find the inputs ourselves via API's (or asking your own full node if you have one) and add then it with tx.addInput(txId, 0).